summary refs log tree commit diff
path: root/synapse/storage/databases/main/presence.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Reduce DB load of /sync when using presence (#12885)Erik Johnston2022-05-311-27/+48
| | | While the query was fast, we were calling it *a lot*.
* Add some type hints to datastore (#12485)Dirk Klimpel2022-04-271-4/+15
|
* Add type hints to `synapse/storage/databases/main` (#11984)Dirk Klimpel2022-02-211-20/+41
|
* Replace uses of simple_insert_many with simple_insert_many_values. (#11742)Patrick Cloke2022-01-131-11/+22
| | | | This should be (slightly) more efficient and it is simpler to have a single method for inserting multiple values.
* checks for generators in database functions (#11564)Richard van der Hoff2021-12-131-3/+2
| | | | | A couple of safety-checks to hopefully stop people doing what I just did, and create a storage function which only works the first time it is called (and not when it is re-run due to a database concurrency error or similar).
* Type hint the constructors of the data store classes (#11555)Sean Quah2021-12-131-3/+3
|
* Fix providing a `RoomStreamToken` instance to ↵Andrew Morgan2021-11-021-1/+1
| | | | | `_notify_app_services_ephemeral` (#11137) Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* Add a partial index to `presence_stream` to speed up startups (#10748)Sean2021-09-031-1/+22
| | | Signed-off-by: Sean Quah <seanq@element.io>
* Fix bug when running presence off master (#10149)Erik Johnston2021-06-111-1/+1
| | | Hopefully fixes #10027.
* Fixed removal of new presence stream states (#10014)Marek Matys2021-05-211-9/+9
| | | | | | | | | Fixes: https://github.com/matrix-org/synapse/issues/9962 This is a fix for above problem. I fixed it by swaping the order of insertion of new records and deletion of old ones. This ensures that we don't delete fresh database records as we do deletes before inserts. Signed-off-by: Marek Matys <themarcq@gmail.com>
* Use a database table to hold the users that should have full presence sent ↵Andrew Morgan2021-05-181-1/+57
| | | | to them, instead of something in-memory (#9823)
* Split presence out of master (#9820)Erik Johnston2021-04-231-2/+90
|
* 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 a storage method for returning all current presence from all users (#9650)Andrew Morgan2021-03-251-1/+59
| | | | | | | Split off from https://github.com/matrix-org/synapse/pull/9491 Adds a storage method for getting the current presence of all local users, optionally excluding those that are offline. This will be used by the code in #9491 when a PresenceRouter module informs Synapse that a given user should have `"ALL"` user presence updates routed to them. Specifically, it is used here: https://github.com/matrix-org/synapse/blob/b588f16e391d664b11f43257eabf70663f0c6d59/synapse/handlers/presence.py#L1131-L1133 Note that there is a `get_all_presence_updates` function just above. That function is intended to walk up the table through stream IDs, and is primarily used by the presence replication stream. I could possibly make use of it in the PresenceRouter-related code, but it would be a bit of a bodge.
* Update black, and run auto formatting over the codebase (#9381)Eric Eastwood2021-02-161-1/+3
| | | | | | | - 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
* Use `async with` for ID gens (#8383)Erik Johnston2020-09-231-2/+2
| | | This will allow us to hit the DB after we've finished using the generated stream ID.
* Make StreamIdGen `get_next` and `get_next_mult` async (#8161)Erik Johnston2020-08-251-1/+1
| | | | This is mainly so that `StreamIdGenerator` and `MultiWriterIdGenerator` will have the same interface, allowing them to be used interchangeably.
* Convert stream database to async/await. (#8074)Patrick Cloke2020-08-171-1/+1
|
* Remove some unused database functions. (#8085)Patrick Cloke2020-08-141-21/+0
|
* Convert misc database code to async (#8087)Patrick Cloke2020-08-141-6/+3
|
* Convert appservice, group server, profile and more databases to async (#8066)Patrick Cloke2020-08-121-5/+2
|
* Rename database classes to make some sense (#8033)Erik Johnston2020-08-051-0/+186