Partially-stated room that we fail to join updates current state and indicates that it's in the room #17602
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.
(This is more bug report than PR, please someone else take this on)
Partially-stated room that we fail to join, updates current state and indicates that it's in the room (
delta_state.no_longer_in_room = False
).Test to reproduce:
In
_trial_temp/test.log
, we can observe:Wtf?
no_longer_in_room=False
seems to indicate that they currently in the room 😖. There is nocurrent_state_events
for this room so this doesn't line up.This behavior was first introduced in matrix-org/synapse#13403 and the only reason it doesn't end up calling
_update_current_state_txn(...)
now is because #17215 added someif state_delta.is_noop():
protection (for something unrelated AFAICT).It's very confusing for a partially stated room to come through this flow indicating that it is still in the room (
delta_state.no_longer_in_room = False
).Normally,
no_longer_in_room
is set atsynapse/synapse/storage/controllers/persist_events.py
Lines 728 to 750 in 92b38c1
But there is a different flow that the partial-stated rooms use that doesn't bother setting
delta_state.no_longer_in_room
at all,synapse/synapse/storage/controllers/persist_events.py
Lines 496 to 506 in 92b38c1
Seems like we should update this flow to accurately say
delta_state.no_longer_in_room = True
and make sure any current state events are cleared out. Although, I'm not surecurrent_state_events
are ever added for a partially-stated room in this case.Overall, it's very easy to overlook this kind of thing because we default
no_longer_in_room
toFalse
so you don't need to provide it when creating aDeltaState(...)
.Found while working on #17512
Pull Request Checklist
EventStore
toEventWorkerStore
.".code blocks
.(run the linters)