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
Fix join being denied after being invited over federation #18075
Fix join being denied after being invited over federation #18075
Changes from 38 commits
e4c3e7b
d31ff53
1d64beb
a32c1ba
9a35155
825b249
0698dcf
8c6b294
e4dad14
7e60ec0
ad8ed0c
d0639e4
7855892
b3bda0e
0d01cda
83237f7
1779d76
4f0cf80
741f256
a736ead
70cbff8
9716478
05c875c
0a757b6
d9bf5a9
f885575
87cfe87
33ac6c9
0d871b6
2fbc2fa
bbeb68a
11d9970
872f717
d85d84c
14dc54b
139db20
78bee3d
074483d
545f22d
0b31100
27b7c68
d80984e
ab098d9
2d5d246
dc547d6
e9ee86a
6cea84c
42df9e6
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.
For non-backfilled events, we already call
_notify_persisted_event
(just below) ->on_new_room_events
->notify_new_room_events
->notify_replication
Essentially, I want to fill in the context here: We never notify clients about backfilled events but it's important to let all the workers know about any new event (backfilled or not) because TODO
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.
"...they may need to act on that event type"?
One example is facilitating the Synapse Module API; where a module could be loaded on to any worker. A module may want to act on certain types of backfilled events arriving.
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.
@anoadragon453 Are you sure about this? I'm pretty sure the Synapse module
on_new_event
hook doesn't get called for backfilled events. At-least that's my assumption in the Synapse module I've been working on and I even have asserts for it that don't get triggered (which are stressed by some Complement tests doing federation things).But now I'm no longer confident in that assumption.
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.
Ah, sorry! My memory misled me. I've just checked and confirmed that we avoid notifying Synapse modules on backfilled events.
I tried to find the original reasoning behind this, and traced it back to this PR adding the
never notify about backfilled events
comment, but there was no discussion around it.Indeed it makes sense to not wake up /sync streams regarding "old" backfilled events. Though it definitely makes sense to notify workers - as many react to events that change the state of the room. This PR is a great use case of why we should notify workers about backfilled events (and the comment above could reference this).
I'd argue that modules should probably know about them as well, and could choose to ignore them if desired. Just calling
on_new_event
now might break some modules though - perhaps we could add anon_backfilled_event
module API or similar in future. That's outside the scope of this PR though.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.
This doesn't feel quite right yet. I don't think backfilled events can change the current state of the room.
Related reading in
room-dag-concepts.md
but it doesn't concretely answer this.For example in this case,
/invite
callspersist_events_and_notify(...)
withbackfilled=False
so this PR isn't a use case of this specific call as_notify_persisted_event
(just below for non-backfilled events) already covers it.I'm really trying to come at this from an actual use case. It feels like workers should know about backfilled events but then I can't come up with a concrete example.
I think that I'll merge this PR for now and I can update this spot once we actually suss this out
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.
@erikjohnston do you have any insight into use cases where backfilled events should be replicated to all workers?