Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Initialise: make snapshots instead of prepending state events #310
Initialise: make snapshots instead of prepending state events #310
Changes from 4 commits
c5ca140
9e135e2
8f3c7ab
4b9b98a
a43792d
1459358
5e7525b
bc71022
c167774
827e29c
a98cf0f
9b2e76b
22e14c0
e7251f7
740c158
1aca0c7
9bc2962
50ea5ed
c27b557
3823067
bc1c595
b11ed53
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I seem to have forgotten to do this... but the room name changes are seen in the tests. Does that mean the cache invalidation payload isn't needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those tests are only testing cache invalidation via redaction, not cache invalidation via joining a room after a long period of no one being in the room. The latter case is what we're trying to catch here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't follow. I specifically mean
TestGappyState
andTestGappyStateDoesNotAccumulateTheStateBlock
, neither of which emit a redaction event.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't actually use the return value here. At some point I was more ambitious and wanted to reuse this machinery in Accumulate... but then I decided that was not really getting us anything and left it for a rainy day.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels a little inefficient to convert from
[]Event
to maps and then back to[]int64
again if we're only changing the state by one event. But we're optimising for leaving and rejoining large rooms here, with large gappy state blocks. We've seen gappy state blocks of size multiple thousands on the m.org deployment!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only want event NID, type and state key here, so we could use a more specialised query here to fetch less data.