Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix age field check in event echo processing #3635

Merged
merged 2 commits into from
Dec 5, 2024

Conversation

stas-demydiuk
Copy link
Contributor

@stas-demydiuk stas-demydiuk commented Jul 28, 2023

Address an edge case when the server does not return the age field for some reason (as it seems like it is optional according to spec) to avoid NaN value in the event's localTimestamp field

Fixes element-hq/element-web#25875

Signed-off-by: Stanislav Demydiuk s.demydiuk@gmail.com

Checklist

  • Tests written for new code (and old code if feasible)
  • Linter and other CI checks pass
  • Sign-off given on the changes (see CONTRIBUTING.md)

Here's what your changelog entry will look like:

🐛 Bug Fixes

Copy link
Contributor

@germain-gg germain-gg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sane to me, thank you for taking care of this!

Would you be able to reference the piece of the spec in the pull request that mentions it is optional and add a test to validate the behaviour you're covering now?

timokoesters added a commit to timokoesters/conduit that referenced this pull request Aug 21, 2023
Workaround for element web while waiting for matrix-org/matrix-js-sdk#3635
@isosphere
Copy link

Looks sane to me, thank you for taking care of this!

Would you be able to reference the piece of the spec in the pull request that mentions it is optional and add a test to validate the behaviour you're covering now?

If you check https://spec.matrix.org/v1.11/client-server-api/#room-event-format

Scroll down a little to ClientEvent, it says of the entire unsigned field:

Contains optional extra information about the event.

Everything that is unsigned is optional.

@richvdh
Copy link
Member

richvdh commented Dec 5, 2024

Related: element-hq/synapse#8429

Copy link
Member

@dbkr dbkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the author hasn't come back on this one, although given it's a simple enough change we think it's valuable enough to merge. A regression test would have been great, but that's on us for not asking before.

@dbkr dbkr added this pull request to the merge queue Dec 5, 2024
github-merge-queue bot pushed a commit that referenced this pull request Dec 5, 2024
Co-authored-by: David Baker <dbkr@users.noreply.github.com>
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 5, 2024
@dbkr dbkr added this pull request to the merge queue Dec 5, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 5, 2024
@dbkr dbkr added this pull request to the merge queue Dec 5, 2024
Merged via the queue into matrix-org:develop with commit c90ea98 Dec 5, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Defect Z-Community-PR Issue is solved by a community member's PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Threads on Conduit are not updating
5 participants