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

Use a database table to hold the users that should have full presence sent to them, instead of something in-memory #9823

Merged
merged 30 commits into from
May 18, 2021
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
cce22cd
Add a util file for non API-specific constants, and move ONE_HOUR to it
anoadragon453 Apr 15, 2021
84fb5f0
Add migration and storage methods for users_to_send_full_presence_to …
anoadragon453 Apr 15, 2021
f7e6887
Modify ModuleApi to upsert entries into our new table
anoadragon453 Apr 15, 2021
9d9f46d
Modify SyncHandler to pull from the new table
anoadragon453 Apr 15, 2021
a71fd40
Changelog
anoadragon453 Apr 15, 2021
0951d36
Remove users_to_send_full_presence_to table culling; add fk for user_id
anoadragon453 May 5, 2021
3ebbc96
Add presence_stream_id column to users_to_send_full_presence_to table
anoadragon453 May 5, 2021
245e672
Updating tests to account for new stream-token based sync tracking
anoadragon453 May 10, 2021
b4e7e9d
Fix stream token multiple devices
anoadragon453 May 11, 2021
337197d
Add a new key to presence_set_state replication request, force_notify
anoadragon453 May 11, 2021
0b15230
self -> test_case. Fix worker-based test
anoadragon453 May 12, 2021
822f87a
Modify send_local_online_presence_to to send to local users on non-fe…
anoadragon453 May 12, 2021
2e408ac
lint
anoadragon453 May 12, 2021
7ca6618
Revert server_notices_manager change
anoadragon453 May 12, 2021
6b54010
Don't commit :memory: -> test.db :)
anoadragon453 May 12, 2021
ce73710
Revert "Modify send_local_online_presence_to to send to local users o…
anoadragon453 May 12, 2021
839f671
Send Server Notices change was required after all
anoadragon453 May 12, 2021
a907e0a
Switch to using PresenceFederationQueue.send_presence_to_destinations
anoadragon453 May 12, 2021
d2f07a7
No need to split a single-use constant out to a separate file
anoadragon453 May 12, 2021
682e125
Describe force_notify in docstrings
anoadragon453 May 12, 2021
6839bcf
Have the handler call the storage method, not the other way around
anoadragon453 May 12, 2021
726d705
Call send_presence_to_destinations properly
anoadragon453 May 13, 2021
e603a77
Fix presence router test
anoadragon453 May 13, 2021
0bbca77
Only bump the max presence stream ID once
anoadragon453 May 13, 2021
7b8d008
Clarify notice of where ModuleApi.send_local_online_presece_to can be…
anoadragon453 May 13, 2021
db3befd
Fix iterator/iterable, and passing UserID
anoadragon453 May 14, 2021
48bedea
Update synapse/module_api/__init__.py
anoadragon453 May 17, 2021
a9875aa
Iterable -> Sequence; lint
anoadragon453 May 17, 2021
22e1795
Perform an empty check, switch back to next(iter(x))
anoadragon453 May 17, 2021
68073af
Don't have the same function name in a Handler and Store class
anoadragon453 May 17, 2021
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
4 changes: 2 additions & 2 deletions synapse/handlers/presence.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,8 @@ async def add_users_to_send_full_presence_to(self, user_ids: Iterable[str]):
# correctly won't receive a second snapshot.

# Get the current presence state for one of the users (defaults to offline if not found)
user_id = yield user_ids
current_presence_state = await self.get_state(user_id)
user_id = next(iter(user_ids))
current_presence_state = await self.get_state(UserID.from_string(user_id))

# Convert the UserPresenceState object into a serializable dict
state = {
Expand Down