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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

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.

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
3 participants