Skip to content

Fix timeline jumpiness by setting correct txnId #1663

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

Merged
merged 8 commits into from
Apr 12, 2021

Conversation

germain-gg
Copy link
Contributor

Fixes element-hq/element-web#16914

Regression introduced by #1655

I incorrectly tried to remove pending events in updatePendingEvent when this reconciliation is the responsability of that transaction ID. This PR sets that txnId attribute properly and remove the need to explicitely call removePendingEvent as the event is now going through the usual timeline flow

@t3chguy raised an interesting comment in my previous pull request that is adressed here. The txnId is now persisted in storage and re-used at a later stage to ensure idempotency

@germain-gg germain-gg requested a review from a team April 12, 2021 08:54
@germain-gg germain-gg force-pushed the gsouquet-timeline-jumpiness branch from 5c840ca to 7371f8d Compare April 12, 2021 08:55
@germain-gg germain-gg requested review from t3chguy and jryans April 12, 2021 11:27
@germain-gg
Copy link
Contributor Author

@t3chguy / @jryans thank you for your review earlier.

I have undone my changes to event.toJSON to avoid changing the "View Source" payload.
In addition to that the messages persisted to localStorage respect the "encryption" setting set by the room they were sent in

Using the spread operator I can persist all the enumerable properties on the event and add the txnId. Failing to do that rings all alarm bells about a potential replay attack

Copy link
Collaborator

@jryans jryans left a comment

Choose a reason for hiding this comment

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

Perhaps sprinkle in some comments on encryption expectations, but otherwise seems good to me. 😄

@germain-gg germain-gg merged commit 1dddcd4 into develop Apr 12, 2021
@germain-gg germain-gg deleted the gsouquet-timeline-jumpiness branch April 12, 2021 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Timeline weirdly jumps when I send a message
3 participants