Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Wait for lazy join to complete when getting current state #12872

Merged
merged 23 commits into from
Jun 1, 2022
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
78faa1a
Rename StateGroupStorage
erikjohnston May 25, 2022
334844d
Add fetching current state funcs to StateStorage
erikjohnston May 25, 2022
fe86915
Use StateStorage.get_current_state_ids
erikjohnston May 25, 2022
a2465b8
Use StateStorage.get_filtered_current_state_ids
erikjohnston May 25, 2022
a2945a5
Use StateStorage.get_current_state_deltas
erikjohnston May 25, 2022
e786f68
Rename to get_partial_current_state_ids
erikjohnston May 25, 2022
3f74b37
Rename to get_partial_filtered_current_state_ids
erikjohnston May 25, 2022
c068581
Rename to get_partial_current_state_deltas
erikjohnston May 25, 2022
6f386d1
Block calls to `get_current_state_ids` and co. when have partial state
erikjohnston May 25, 2022
2b674f8
Add test for `PartialCurrentStateTracker`
erikjohnston May 25, 2022
ecae768
Newsfile
erikjohnston May 25, 2022
d1a1d6a
Don't block sync when lazy joining a room
erikjohnston May 25, 2022
531955f
Fix type annotation
erikjohnston May 25, 2022
6cc7269
Apply suggestions from code review
erikjohnston May 26, 2022
3a20548
s/self.storage/self._storage/
erikjohnston May 27, 2022
6e7625e
s/is_room_got_partial_state/has_room_only_got_partial_state/
erikjohnston May 27, 2022
711ea44
Merge get_filtered and get_current_state_ids
erikjohnston May 27, 2022
1f99ce0
Merge remote-tracking branch 'origin/develop' into erikj/await_curren…
erikjohnston May 27, 2022
b59418f
Merge remote-tracking branch 'origin/develop' into erikj/await_curren…
erikjohnston May 31, 2022
c6fe132
Fix up naming
erikjohnston May 31, 2022
4757b00
Apply suggestions from code review
erikjohnston Jun 1, 2022
b6cb65f
Lint
erikjohnston Jun 1, 2022
c513c20
Rename has_room_only_got_partial_state
erikjohnston Jun 1, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion synapse/handlers/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,11 @@ async def _load_filtered_recents(
# ensure that we always include current state in the timeline
current_state_ids = frozenset()
if any(e.is_state() for e in loaded_recents):
# FIXME(faster room joins): We use the partial state here as
erikjohnston marked this conversation as resolved.
Show resolved Hide resolved
# we don't want to block `/sync` on finishing a lazy join.
# Is this the correct way of doing it?
current_state_ids_map = (
await self.state_storage.get_current_state_ids(room_id)
await self.store.get_partial_current_state_ids(room_id)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a check to see if the state event we're about to send down to clients is in the current state, and if so to always send it even if filter_events_for_client would filter it out. Not sure if using get_partial_current_state_ids is the right approach here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really following, but this is something we can return to.

)
current_state_ids = frozenset(current_state_ids_map.values())

Expand Down