Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce overhead of sliding sync E2EE loops #17771

Merged
merged 2 commits into from
Sep 30, 2024
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/17771.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Reduce overhead of sliding sync E2EE loops.
2 changes: 1 addition & 1 deletion synapse/api/auth/msc3861_delegated.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ async def get_user_by_access_token(
logger.exception("Failed to introspect token")
raise SynapseError(503, "Unable to introspect the access token")

logger.info(f"Introspection result: {introspection_result!r}")
logger.debug("Introspection result: %r", introspection_result)

# TODO: introspection verification should be more extensive, especially:
# - verify the audience
Expand Down
11 changes: 6 additions & 5 deletions synapse/handlers/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
wrap_as_background_process,
)
from synapse.storage.databases.main.client_ips import DeviceLastConnectionInfo
from synapse.storage.databases.main.roommember import EventIdMembership
from synapse.storage.databases.main.state_deltas import StateDelta
from synapse.types import (
DeviceListUpdates,
Expand Down Expand Up @@ -222,7 +223,6 @@ async def get_device_changes_in_shared_rooms(
return changed

@trace
@measure_func("device.get_user_ids_changed")
@cancellable
async def get_user_ids_changed(
self, user_id: str, from_token: StreamToken
Expand Down Expand Up @@ -290,9 +290,11 @@ async def get_user_ids_changed(
memberships_to_fetch.add(delta.prev_event_id)

# Fetch all the memberships for the membership events
event_id_to_memberships = await self.store.get_membership_from_event_ids(
memberships_to_fetch
)
event_id_to_memberships: Mapping[str, Optional[EventIdMembership]] = {}
if memberships_to_fetch:
event_id_to_memberships = await self.store.get_membership_from_event_ids(
memberships_to_fetch
)

joined_invited_knocked = (
Membership.JOIN,
Expand Down Expand Up @@ -349,7 +351,6 @@ async def get_user_ids_changed(

return device_list_updates

@measure_func("_generate_sync_entry_for_device_list")
async def generate_sync_entry_for_device_list(
self,
user_id: str,
Expand Down
Loading