-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add depth
parameter and pipe through the event creation methods
#10049
Conversation
synapse/handlers/room_member.py
Outdated
@@ -496,160 +561,170 @@ async def update_membership_locked( | |||
if block_invite: | |||
raise SynapseError(403, "Invites have been disabled on this server") | |||
|
|||
latest_event_ids = await self.store.get_prev_events_for_room(room_id) | |||
if prev_event_ids: | |||
latest_event_ids = prev_event_ids |
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.
New case is here where we override the prev_event_ids if passed in explicitly
https://github.com/matrix-org/synapse/pull/9247/files#r610994535
synapse/handlers/room_member.py
Outdated
if prev_event_ids: | ||
latest_event_ids = prev_event_ids | ||
else: | ||
latest_event_ids = await self.store.get_prev_events_for_room(room_id) |
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.
All of this code is just nested under the
else
conditional and not changed.https://github.com/matrix-org/synapse/pull/9247/files#r610994518
697949c
to
b9952cf
Compare
inherit_depth
parameter through the event creation methodsinherit_depth
parameter and pipe through the event creation methods
b9952cf
to
280d6da
Compare
Also add auth_event_ids and prev_event_ids in some places as well. Split out from #9247 Call stacks: ``` create_and_send_nonmember_event create_event create_new_client_event builder.build ``` ``` update_membership update_membership_locked _local_membership_update create_event ```
280d6da
to
3e747bc
Compare
synapse/events/builder.py
Outdated
oldest_successor_depth, | ||
) = await self._store.get_min_depth_of(successor_event_ids) | ||
|
||
depth = oldest_successor_depth |
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 smarts of inherit_depth
are 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.
These look like changes that would work :)
I feel like the remaining failing Sytest tests are just flakey. They are different when I re-run them. Trying to get it running locally to confirm, matrix-org/sytest#1054 |
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.
Thanks, this looks good other than tiny nit
…the event dictionary See #10049 (comment)
63bf8f6
to
bd28bda
Compare
@erikjohnston Thanks for all the review so far 🎢 |
I think this is good to merge, but I'm going to hold off a bit until we #9247 is a bit closer (in particular I'm wondering if we should pass in the depth explicitly, rather than have |
…the event dictionary See #10049 (comment)
@erikjohnston I've updated this PR and the base PR to pass around |
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 looks good, thanks, but again let's wait for the other PR before landing this
inherit_depth
parameter and pipe through the event creation methodsdepth
parameter and pipe through the event creation methods
Add
depth
parameter and pipe through the event creation methods. Also addauth_event_ids
andprev_event_ids
in some places as well so I don't have to go through PR splitting conflict hell.Split out from #9247
Call stacks:
Pull Request Checklist
EventStore
toEventWorkerStore
.".code blocks
.