summary refs log tree commit diff
path: root/synapse/handlers/initial_sync.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Pass the requester during event serialization. (#15174)Quentin Gliech2023-03-061-15/+36
| | | | This allows Synapse to properly include the transaction ID in the unsigned data of events.
* Bump black from 22.12.0 to 23.1.0 (#15103)dependabot[bot]2023-02-221-1/+0
|
* Avoid fetching unused account data in sync. (#14973)Patrick Cloke2023-02-101-3/+2
| | | | | | | The per-room account data is no longer unconditionally fetched, even if all rooms will be filtered out. Global account data will not be fetched if it will all be filtered out.
* Use an enum for direction. (#14927)Patrick Cloke2023-01-271-2/+14
| | | | For better type safety we use an enum instead of strings to configure direction (backwards or forwards).
* Merge account data streams (#14826)Erik Johnston2023-01-131-3/+5
|
* Do not allow a None-limit on PaginationConfig. (#14146)Patrick Cloke2022-10-141-23/+4
| | | | | | | The callers either set a default limit or manually handle a None-limit later on (by setting a default value). Update the callers to always instantiate PaginationConfig with a default limit and then assume the limit is non-None.
* `synapse.api.auth.Auth` cleanup: make permission-related methods use ↵Quentin Gliech2022-08-221-3/+3
| | | | | | | | | `Requester` instead of the `UserID` (#13024) Part of #13019 This changes all the permission-related methods to rely on the Requester instead of the UserID. This is a first step towards enabling scoped access tokens at some point, since I expect the Requester to have scope-related informations in it. It also changes methods which figure out the user/device/appservice out of the access token to return a Requester instead of something else. This avoids having store-related objects in the methods signatures.
* Support stable identifiers for MSC2285: private read receipts. (#13273)Šimon Brandner2022-08-051-7/+4
| | | | | This adds support for the stable identifiers of MSC2285 while continuing to support the unstable identifiers behind the configuration flag. These will be removed in a future version.
* Reduce the amount of state we pull from the DB (#12811)Erik Johnston2022-06-061-2/+4
|
* Rename storage classes (#12913)Erik Johnston2022-05-311-7/+10
|
* Additional constants for EDU types. (#12884)Patrick Cloke2022-05-271-2/+2
| | | Instead of hard-coding strings in many places.
* Fix up `state_store` naming (#12871)Erik Johnston2022-05-251-3/+3
|
* Add `StreamKeyType` class and replace string literals with constants (#12567)Andrew Morgan2022-05-161-5/+8
|
* Avoid unnecessary copies when filtering private read receipts. (#12711)Šimon Brandner2022-05-161-2/+4
| | | | | | A minor optimization to avoid unnecessary copying/building identical dictionaries when filtering private read receipts. Also clarifies comments and cleans-up some tests.
* Use `private` instead of `hidden` in MSC2285 related code. (#12635)Šimon Brandner2022-05-051-2/+2
|
* Use `ParamSpec` in type hints for `synapse.logging.context` (#12150)Sean Quah2022-03-081-2/+3
| | | | Signed-off-by: Sean Quah <seanq@element.io>
* Use the proper serialization format when bundling aggregations. (#12090)Patrick Cloke2022-03-031-3/+6
| | | | This ensures that the `latest_event` field of the bundled aggregation for threads uses the same format as the other events in the response.
* Remove `HomeServer.get_datastore()` (#12031)Richard van der Hoff2022-02-231-1/+1
| | | | | | | The presence of this method was confusing, and mostly present for backwards compatibility. Let's get rid of it. Part of #11733
* Bundle aggregations outside of the serialization method. (#11612)Patrick Cloke2022-01-071-9/+7
| | | | | | | | This makes the serialization of events synchronous (and it no longer access the database), but we must manually calculate and provide the bundled aggregations. Overall this should cause no change in behavior, but is prep work for other improvements.
* Do not bundle aggregations for APIs which shouldn't include them. (#11592)Patrick Cloke2021-12-201-14/+4
| | | | | And make bundling aggregations opt-in, instead of opt-out to avoid having APIs to include extraneous data (and being much heavier than necessary).
* Add missing type hints to `synapse.logging.context` (#11556)Sean Quah2021-12-141-14/+19
|
* Include bundled aggregations in /sync and related fixes (#11478)Patrick Cloke2021-12-061-6/+24
| | | | | | | | Due to updates to MSC2675 this includes a few fixes: * Include bundled aggregations for /sync. * Do not include bundled aggregations for /initialSync and /events. * Do not bundle aggregations for state events. * Clarifies comments and variable names.
* Remove the deprecated BaseHandler. (#11005)Patrick Cloke2021-10-081-4/+4
| | | | | | | | The shared ratelimit function was replaced with a dedicated RequestRatelimiter class (accessible from the HomeServer object). Other properties were copied to each sub-class that inherited from BaseHandler.
* Add type hints for event streams. (#10856)Patrick Cloke2021-09-211-1/+1
|
* Require type hints in the handlers module. (#10831)Patrick Cloke2021-09-201-4/+4
| | | | | | | Adds missing type hints to methods in the synapse.handlers module and requires all methods to have type hints there. This also removes the unused construct_auth_difference method from the FederationHandler.
* Use direct references for some configuration variables (part 2) (#10812)Patrick Cloke2021-09-151-1/+1
|
* Convert room member storage tuples to attrs. (#10629)Patrick Cloke2021-08-181-1/+1
| | | | Instead of using namedtuples. This helps with asserting type hints and code completion.
* Support for MSC2285 (hidden read receipts) (#10413)Šimon Brandner2021-07-281-1/+6
| | | Implementation of matrix-org/matrix-doc#2285
* Use inline type hints in `handlers/` and `rest/`. (#10382)Jonathan de Jong2021-07-161-3/+11
|
* Remove redundant "coding: utf-8" lines (#9786)Jonathan de Jong2021-04-141-1/+0
| | | | | | | Part of #9744 Removes all redundant `# -*- coding: utf-8 -*-` lines from files, as python 3 automatically reads source code as utf-8 now. `Signed-off-by: Jonathan de Jong <jonathan@automatia.nl>`
* Add ResponseCache tests. (#9458)Jonathan de Jong2021-03-081-1/+1
|
* Ratelimit cross-user key sharing requests. (#8957)Patrick Cloke2021-02-191-2/+2
|
* Update black, and run auto formatting over the codebase (#9381)Eric Eastwood2021-02-161-3/+9
| | | | | | | - Update black version to the latest - Run black auto formatting over the codebase - Run autoformatting according to [`docs/code_style.md `](https://github.com/matrix-org/synapse/blob/80d6dc9783aa80886a133756028984dbf8920168/docs/code_style.md) - Update `code_style.md` docs around installing black to use the correct version
* Add additional type hints to the storage module. (#8980)Patrick Cloke2020-12-301-3/+1
|
* Add type hints to profile and base handlers. (#8609)Patrick Cloke2020-10-211-2/+6
|
* Add type hints to response cache. (#8507)Patrick Cloke2020-10-091-4/+6
|
* Make token serializing/deserializing async (#8427)Erik Johnston2020-09-301-7/+7
| | | The idea is that in future tokens will encode a mapping of instance to position. However, we don't want to include the full instance name in the string representation, so instead we'll have a mapping between instance name and an immutable integer ID in the DB that we can use instead. We'll then do the lookup when we serialize/deserialize the token (we could alternatively pass around an `Instance` type that includes both the name and ID, but that turns out to be a lot more invasive).
* Various clean ups to room stream tokens. (#8423)Erik Johnston2020-09-291-1/+2
|
* Simplify super() calls to Python 3 syntax. (#8344)Patrick Cloke2020-09-181-1/+1
| | | | | | | This converts calls like super(Foo, self) -> super(). Generated with: sed -i "" -Ee 's/super\([^\(]+\)/super()/g' **/*.py
* Make `StreamToken.room_key` be a `RoomStreamToken` instance. (#8281)Erik Johnston2020-09-111-2/+2
|
* Clean up types for PaginationConfig (#8250)Erik Johnston2020-09-081-6/+5
| | | This removes `SourcePaginationConfig` and `get_pagination_rows`. The reasoning behind this is that these generic classes/functions erased the types of the IDs it used (i.e. instead of passing around `StreamToken` it'd pass in e.g. `token.room_key`, which don't have uniform types).
* Add type hints to more handlers (#8244)Erik Johnston2020-09-031-32/+48
|
* Convert streams to async. (#8014)Patrick Cloke2020-08-041-2/+2
|
* Stop the master relaying USER_SYNC for other workers (#7318)Richard van der Hoff2020-04-221-2/+8
| | | | | | | Long story short: if we're handling presence on the current worker, we shouldn't be sending USER_SYNC commands over replication. In an attempt to figure out what is going on here, I ended up refactoring some bits of the presencehandler code, so the first 4 commits here are non-functional refactors to move this code slightly closer to sanity. (There's still plenty to do here :/). Suggest reviewing individual commits. Fixes (I hope) #7257.
* Add `allow_departed_users` param to `check_in_room_or_world_readable`Richard van der Hoff2020-02-191-1/+3
| | | | | | | ... and set it everywhere it's called. while we're here, rename it for consistency with `check_user_in_room` (and to help check that I haven't missed any instances)
* Refactor the membership check methods in AuthRichard van der Hoff2020-02-181-26/+5
| | | | | these were getting a bit unwieldy, so let's combine `check_joined_room` and `check_user_was_in_room` into a single `check_user_in_room`.
* Add `local_current_membership` table (#6655)Erik Johnston2020-01-151-1/+1
| | | | | | | Currently we rely on `current_state_events` to figure out what rooms a user was in and their last membership event in there. However, if the server leaves the room then the table may be cleaned up and that information is lost. So lets add a table that separately holds that information.
* Port synapse.handlers.initial_sync to async/awaitErik Johnston2019-12-091-52/+44
|
* Remove SnapshotCache in favour of ResponseCacheErik Johnston2019-12-091-11/+8
|
* Update black to 19.10b0 (#6304)Amber Brown2019-11-011-2/+2
| | | * update version of black and also fix the mypy config being overridden
* Port to use state storageErik Johnston2019-10-301-5/+9
|
* Remove double return statements (#5962)Andrew Morgan2019-09-031-2/+0
| | | | | | | | | | Remove all the "double return" statements which were a result of us removing all the instances of ``` defer.returnValue(...) return ``` statements when we switched to python3 fully.
* Remove unnecessary parentheses around return statements (#5931)Andrew Morgan2019-08-301-2/+2
| | | | | Python will return a tuple whether there are parentheses around the returned values or not. I'm just sick of my editor complaining about this all over the place :)
* Replace returnValue with return (#5736)Amber Brown2019-07-231-29/+25
|
* Move logging utilities out of the side drawer of util/ and into logging/ (#5606)Amber Brown2019-07-041-1/+1
|
* Run Black. (#5482)Amber Brown2019-06-201-87/+83
|
* Allow client event serialization to be asyncErik Johnston2019-05-141-17/+27
|
* Deny peeking into rooms that have been blockedErik Johnston2019-03-211-1/+5
|
* Refactor state group lookup to reduce DB hits (#4011)Erik Johnston2018-10-251-2/+2
| | | | | | | | Currently when fetching state groups from the data store we make two hits two the database: once for members and once for non-members (unless request is filtered to one or the other). This adds needless load to the datbase, so this PR refactors the lookup to make only a single database hit.
* Integrate presence from hotfixes (#3694)Amber Brown2018-08-181-0/+4
|
* Rename async to async_helpers because `async` is a keyword on Python 3.7 (#3678)Amber Brown2018-08-101-1/+1
|
* another couple of logcontext leaksRichard van der Hoff2018-07-241-4/+6
|
* Logcontext fixesRichard van der Hoff2018-07-241-13/+15
| | | | Fix some random logcontext leaks.
* run isortAmber Brown2018-07-091-6/+3
|
* Fix returned token is no longer a tupleErik Johnston2018-05-091-1/+1
|
* Refactor get_recent_events_for_room return typeErik Johnston2018-05-091-5/+5
| | | | | | There is no reason to return a tuple of tokens when the last token is always the token passed as an argument. Changing it makes it consistent with other storage APIs
* Use run_in_background in preference to preserve_fnRichard van der Hoff2018-04-271-5/+7
| | | | | | While I was going through uses of preserve_fn for other PRs, I converted places which only use the wrapped function once to use run_in_background, to avoid creating the function object.
* Remove preserve_context_over_{fn, deferred}Richard van der Hoff2017-11-141-2/+2
| | | | | Both of these functions ae known to leak logcontexts. Replace the remaining calls to them and kill them off.
* replace 'except:' with 'except Exception:'Richard van der Hoff2017-10-231-1/+1
| | | | what could possibly go wrong
* Format presence events on the edges instead of reformatting them multiple timesErik Johnston2017-03-151-1/+10
|
* Shuffle receipt handler around so that worker apps don't need to load itErik Johnston2016-11-231-3/+4
|
* Support /initialSync in synchrotron workerErik Johnston2016-09-211-0/+443