This repository has been archived by the owner on Nov 14, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 677
Fix RewritesState bug #1557
Merged
Merged
Fix RewritesState bug #1557
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4156ace
Set RewritesState once
neilalexander c01632c
Check if any new state provided
neilalexander 22f0f9f
Merge branch 'master' into neilalexander/rewrite
neilalexander 1544310
Obey rewritesState
neilalexander d2ad0ed
Don't nuke everything the sync API knows when purging state
neilalexander 6c2a5b4
Fix panic from duplicate insert
neilalexander eb0ce0c
Consistency
neilalexander 246fbf1
Use HasState
neilalexander 42438d9
Remove nolint
neilalexander 0afe7ae
Clean up joined rooms on state rewrite
neilalexander File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
Whilst this makes sense, why did you change it so it's only set if we don't rewrite state? I think
updater.CurrentStateSnapshotNID()
just returns an int - theNew...
function did the DB query so it's not even an optimisation. Maybe to act as a guard against accidentally fiddling with it and calculating deltas against things we shouldn't?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.
The idea is that, if we are rewriting state, we want the state snapshot NID to be zero because that means that the deltas produced later on will be against an empty snapshot (effectively a complete rewrite, where
AddsStateEventIDs
will contain the entire new state).If we aren't rewriting state, we want to know what the current state is so that we produce a real delta.