Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Fix sync bug when accepting invites #4956

Merged
merged 4 commits into from
Apr 2, 2019
Merged

Fix sync bug when accepting invites #4956

merged 4 commits into from
Apr 2, 2019

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Mar 27, 2019

Hopefully this time we really will fix #4422.

We need to make sure that the cache on get_rooms_for_user_with_stream_ordering is invalidated before the SyncHandler is notified for the new events, and we can now do so reliably via the events stream.

Based on #4955.

@richvdh richvdh requested a review from a team March 27, 2019 22:17
@codecov
Copy link

codecov bot commented Mar 27, 2019

Codecov Report

Merging #4956 into develop will increase coverage by 0.03%.
The diff coverage is 87.5%.

@@            Coverage Diff             @@
##           develop   #4956      +/-   ##
==========================================
+ Coverage    60.57%   60.6%   +0.03%     
==========================================
  Files          331     331              
  Lines        34213   34219       +6     
  Branches      5655    5657       +2     
==========================================
+ Hits         20723   20738      +15     
+ Misses       12015   12007       -8     
+ Partials      1475    1474       -1

richvdh added 3 commits March 28, 2019 18:33
Hopefully this time we really will fix #4422.

We need to make sure that the cache on
`get_rooms_for_user_with_stream_ordering` is invalidated *before* the
SyncHandler is notified for the new events, and we can now do so reliably via
the `events` stream.
Fixes a race in the `get_rooms_for_user_with_stream_ordering` cache
invalidation. Hopefully, won't break anything else.
@richvdh richvdh force-pushed the rav/sync_cache_bug_v3 branch from 8660570 to 10027b6 Compare March 28, 2019 18:47
self.get_rooms_for_user_with_stream_ordering.invalidate(
(data.state_key, ),
)

Copy link
Member

Choose a reason for hiding this comment

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

Can we add an else clause that raises an exception please? Or at least logs loudly.

Copy link
Member Author

Choose a reason for hiding this comment

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

done d7e3729

@richvdh richvdh merged commit 297bf25 into develop Apr 2, 2019
@richvdh richvdh deleted the rav/sync_cache_bug_v3 branch April 2, 2019 11:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants