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

Rework stream token to stop caring about groups. #12897

Merged
merged 3 commits into from
May 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions changelog.d/12897.removal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove support for the non-standard groups/communities feature from Synapse.
4 changes: 2 additions & 2 deletions synapse/streams/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def get_current_token(self) -> StreamToken:
push_rules_key = self.store.get_max_push_rules_stream_id()
to_device_key = self.store.get_to_device_stream_token()
device_list_key = self.store.get_device_stream_token()
groups_key = self.store.get_group_stream_token()

token = StreamToken(
room_key=self.sources.room.get_current_key(),
Expand All @@ -65,7 +64,8 @@ def get_current_token(self) -> StreamToken:
push_rules_key=push_rules_key,
to_device_key=to_device_key,
device_list_key=device_list_key,
groups_key=groups_key,
# Groups key is unused.
groups_key=0,
)
return token

Expand Down
6 changes: 5 additions & 1 deletion synapse/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ class StreamToken:
6. `push_rules_key`: `541479`
7. `to_device_key`: `274711`
8. `device_list_key`: `265584`
9. `groups_key`: `1`
9. `groups_key`: `1` (note that this key is now unused)

You can see how many of these keys correspond to the various
fields in a "/sync" response:
Expand Down Expand Up @@ -691,6 +691,7 @@ class StreamToken:
push_rules_key: int
to_device_key: int
device_list_key: int
# Note that the groups key is no longer used and may have bogus values.
groups_key: int
clokep marked this conversation as resolved.
Show resolved Hide resolved

_SEPARATOR = "_"
Expand Down Expand Up @@ -722,6 +723,9 @@ async def to_string(self, store: "DataStore") -> str:
str(self.push_rules_key),
str(self.to_device_key),
str(self.device_list_key),
# Note that the groups key is no longer used, but it is still
# serialized so that there will not be confusion in the future
# if additional tokens are added.
str(self.groups_key),
]
)
Expand Down