MatrixSynapse/synapse/handlers
David Robertson 80d44060c9
Faster joins: omit partial rooms from eager syncs until the resync completes (#14870)
* Allow `AbstractSet` in `StrCollection`

Or else frozensets are excluded. This will be useful in an upcoming
commit where I plan to change a function that accepts `List[str]` to
accept `StrCollection` instead.

* `rooms_to_exclude` -> `rooms_to_exclude_globally`

I am about to make use of this exclusion mechanism to exclude rooms for
a specific user and a specific sync. This rename helps to clarify the
distinction between the global config and the rooms to exclude for a
specific sync.

* Better function names for internal sync methods

* Track a list of excluded rooms on SyncResultBuilder

I plan to feed a list of partially stated rooms for this sync to ignore

* Exclude partial state rooms during eager sync

using the mechanism established in the previous commit

* Track un-partial-state stream in sync tokens

So that we can work out which rooms have become fully-stated during a
given sync period.

* Fix mutation of `@cached` return value

This was fouling up a complement test added alongside this PR.
Excluding a room would mean the set of forgotten rooms in the cache
would be extended. This means that room could be erroneously considered
forgotten in the future.

Introduced in #12310, Synapse 1.57.0. I don't think this had any
user-visible side effects (until now).

* SyncResultBuilder: track rooms to force as newly joined

Similar plan as before. We've omitted rooms from certain sync responses;
now we establish the mechanism to reintroduce them into future syncs.

* Read new field, to present rooms as newly joined

* Force un-partial-stated rooms to be newly-joined

for eager incremental syncs only, provided they're still fully stated

* Notify user stream listeners to wake up long polling syncs

* Changelog

* Typo fix

Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com>

* Unnecessary list cast

Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com>

* Rephrase comment

Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com>

* Another comment

Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com>

* Fixup merge(?)

* Poke notifier when receiving un-partial-stated msg over replication

* Fixup merge whoops

Thanks MV :)

Co-authored-by: Mathieu Velen <mathieuv@matrix.org>

Co-authored-by: Mathieu Velten <mathieuv@matrix.org>
Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com>
2023-01-23 15:44:39 +00:00
..
ui_auth Fix twisted trunk mypy errors (#14012) 2022-10-03 13:26:49 +00:00
__init__.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
account.py Optionally include account validity in MSC3720 account status responses (#12266) 2022-03-24 11:19:41 +01:00
account_data.py Merge account data streams (#14826) 2023-01-13 14:57:43 +00:00
account_validity.py Implement cancellation support/protection for module callbacks (#12568) 2022-05-09 12:31:14 +01:00
admin.py Show erasure status when listing users in the Admin API (#14205) 2022-10-21 13:52:44 +01:00
appservice.py Improve logging and opentracing for to-device message handling (#14598) 2022-12-06 09:52:55 +00:00
auth.py Add missing type hints to tests.handlers. (#14680) 2022-12-16 11:53:01 +00:00
cas.py Fix twisted trunk mypy errors (#14012) 2022-10-03 13:26:49 +00:00
deactivate_account.py Add a type hint for `get_device_handler()` and fix incorrect types. (#14055) 2022-11-22 14:08:04 -05:00
device.py Enable Faster Remote Room Joins against worker-mode Synapse. (#14752) 2023-01-22 21:10:11 +00:00
devicemessage.py Batch up replication requests to request the resyncing of remote users's devices. (#14716) 2023-01-10 11:17:59 +00:00
directory.py Allow PUT/GET of aliases during faster join (#14292) 2022-11-01 15:02:39 +00:00
e2e_keys.py Batch up replication requests to request the resyncing of remote users's devices. (#14716) 2023-01-10 11:17:59 +00:00
e2e_room_keys.py Remove redundant types from comments. (#14412) 2022-11-16 15:25:24 +00:00
event_auth.py Faster joins: use servers list approximation in `assert_host_in_room` (#14515) 2022-11-24 09:10:47 +01:00
events.py Directly lookup local membership instead of getting all members in a room first (`get_users_in_room` mis-use) (#13608) 2022-08-24 14:13:12 -05:00
federation.py Faster joins: omit partial rooms from eager syncs until the resync completes (#14870) 2023-01-23 15:44:39 +00:00
federation_event.py Wait for streams to catch up when processing HTTP replication. (#14820) 2023-01-18 19:35:29 +00:00
identity.py Remove redundant types from comments. (#14412) 2022-11-16 15:25:24 +00:00
initial_sync.py Merge account data streams (#14826) 2023-01-13 14:57:43 +00:00
message.py Faster remote room joins (worker mode): do not populate external hosts-in-room cache when sending events as this requires blocking for full state. (#14749) 2023-01-11 13:21:53 +00:00
oidc.py Support RFC7636 PKCE in the OAuth 2.0 flow. (#14750) 2023-01-04 14:58:08 -05:00
pagination.py Move `StateFilter` to `synapse.types` (#14668) 2022-12-12 16:19:30 +00:00
password_policy.py Use direct references for some configuration variables (part 3) (#10885) 2021-09-23 07:13:34 -04:00
presence.py Add an early return when handling no-op presence updates. (#14855) 2023-01-16 14:20:12 +00:00
profile.py fix broken avatar checks when server_name contains a port (#13927) 2022-10-26 15:51:23 +01:00
push_rules.py Port the push rule classes to Rust. (#13768) 2022-09-20 12:10:31 +01:00
read_marker.py Refactor and convert `Linearizer` to async (#12357) 2022-04-05 15:43:52 +01:00
receipts.py Include thread information when sending receipts over federation. (#14466) 2022-11-28 14:40:17 +00:00
register.py Move `StateFilter` to `synapse.types` (#14668) 2022-12-12 16:19:30 +00:00
relations.py Parallelize calls to fetch bundled aggregations. (#14510) 2022-11-22 09:47:32 -05:00
room.py Make `handle_new_client_event` throws `PartialStateConflictError` (#14665) 2022-12-15 16:04:23 +00:00
room_batch.py Make `handle_new_client_event` throws `PartialStateConflictError` (#14665) 2022-12-15 16:04:23 +00:00
room_list.py Use stable prefixes for MSC3827: filtering of `/publicRooms` by room type (#13370) 2022-07-27 19:46:57 +01:00
room_member.py Make `handle_new_client_event` throws `PartialStateConflictError` (#14665) 2022-12-15 16:04:23 +00:00
room_member_worker.py Implement knock feature (#6739) 2021-06-09 19:39:51 +01:00
room_summary.py Use the room type from stats in hierarchy response. (#14263) 2022-12-13 08:43:53 -05:00
saml.py Remove redundant types from comments. (#14412) 2022-11-16 15:25:24 +00:00
search.py Improve /sync performance of when passing filters with empty arrays. (#14786) 2023-01-09 08:43:50 -05:00
send_email.py Discourage automatic replies to Synapse's emails (#13957) 2022-09-30 13:23:37 +00:00
set_password.py Add a type hint for `get_device_handler()` and fix incorrect types. (#14055) 2022-11-22 14:08:04 -05:00
sso.py Add support for handling avatar with SSO login (#13917) 2022-11-25 15:16:50 +00:00
state_deltas.py Remove `HomeServer.get_datastore()` (#12031) 2022-02-23 11:04:02 +00:00
stats.py Implement MSC3827: Filtering of `/publicRooms` by room type (#13031) 2022-06-29 17:12:45 +00:00
sync.py Faster joins: omit partial rooms from eager syncs until the resync completes (#14870) 2023-01-23 15:44:39 +00:00
typing.py Better return type for `get_all_entities_changed` (#14604) 2022-12-05 15:19:14 -05:00
user_directory.py Clarifications in user directory for users who share rooms tracking (#13966) 2022-09-30 14:40:18 -05:00