Skip to content

Commit d766b81

Browse files
committed
Review the last places where we use the min stream ID
1 parent 339c90f commit d766b81

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

synapse/handlers/federation.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,10 +698,19 @@ async def do_invite_join(
698698
# We may want to reset the partial state info if it's from an
699699
# old, failed partial state join.
700700
# https://github.com/matrix-org/synapse/issues/13000
701+
702+
# FIXME: Ideally, we would store the full stream token here
703+
# not just the minimum stream ID, so that we can compute an
704+
# accurate list of device changes when un-partial-ing the
705+
# room. The only side effect of this is that we may send
706+
# extra unecessary device list outbound pokes through
707+
# federation, which is harmless.
708+
device_lists_stream_id = self.store.get_device_stream_token().stream
709+
701710
await self.store.store_partial_state_room(
702711
room_id=room_id,
703712
servers=ret.servers_in_room,
704-
device_lists_stream_id=self.store.get_device_stream_token().stream,
713+
device_lists_stream_id=device_lists_stream_id,
705714
joined_via=origin,
706715
)
707716

synapse/storage/databases/main/devices.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1739,7 +1739,7 @@ async def get_device_list_changes_in_rooms(
17391739

17401740
min_stream_id = await self._get_min_device_lists_changes_in_room()
17411741

1742-
# XXX: is that right?
1742+
# Return early if there are no rows to process in device_lists_changes_in_room
17431743
if min_stream_id > from_token.stream:
17441744
return None
17451745

0 commit comments

Comments
 (0)