This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Remove legacy code of single user device resync api #15418
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ccbbfa2
Removed single user devices resync rest servlet class implementation
akstron 3e3a5f1
Removed single user device resync api and its usage from DeviceListWo…
akstron efa8358
Fixed mistake of removing ReplicationUserDevicesResyncRestServlet class
akstron 7f21e3d
changelog added and Signed-off-by: Alok Kumar Singh alokaks601@gmail.com
akstron ad34524
Updated changelog for current PR
akstron 34ad2be
Removed single-user resync usage and updated it to use multi-user cou…
akstron 4275b72
Type fixed
akstron 8ef08bb
Removed user_device_resync implementation
akstron 41ecc88
Removed single user resync test and implementation
akstron fd6a7b6
Updated multi user device resync implementation
akstron File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Always use multi-user device resync replication endpoints. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,7 +70,9 @@ | |
trace, | ||
) | ||
from synapse.metrics.background_process_metrics import run_as_background_process | ||
from synapse.replication.http.devices import ReplicationUserDevicesResyncRestServlet | ||
from synapse.replication.http.devices import ( | ||
ReplicationMultiUserDevicesResyncRestServlet, | ||
) | ||
from synapse.replication.http.federation import ( | ||
ReplicationFederationSendEventsRestServlet, | ||
) | ||
|
@@ -167,8 +169,8 @@ def __init__(self, hs: "HomeServer"): | |
|
||
self._send_events = ReplicationFederationSendEventsRestServlet.make_client(hs) | ||
if hs.config.worker.worker_app: | ||
self._user_device_resync = ( | ||
ReplicationUserDevicesResyncRestServlet.make_client(hs) | ||
self._multi_user_device_resync = ( | ||
ReplicationMultiUserDevicesResyncRestServlet.make_client(hs) | ||
Comment on lines
+172
to
+173
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was going to suggest renaming all of these things to remove the |
||
) | ||
else: | ||
self._device_list_updater = hs.get_device_handler().device_list_updater | ||
|
@@ -1487,9 +1489,11 @@ async def _resync_device(self, sender: str) -> None: | |
|
||
# Immediately attempt a resync in the background | ||
if self._config.worker.worker_app: | ||
await self._user_device_resync(user_id=sender) | ||
await self._multi_user_device_resync(user_ids=[sender]) | ||
else: | ||
await self._device_list_updater.user_device_resync(sender) | ||
await self._device_list_updater.multi_user_device_resync( | ||
user_ids=[sender] | ||
) | ||
except Exception: | ||
logger.exception("Failed to resync device for %s", sender) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We should probably add a TODO comment here that says to resync multiple users at once...
But even if we did that here it seems like the next layer down doesn't do true batching. 🤷