summary refs log tree commit diff
path: root/synapse/storage/databases/main/deviceinbox.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Speed up deleting device messages (#16643)Erik Johnston2023-11-161-25/+81
| | | Keeping track of a lower bound of stream ID where we've deleted everything below makes the queries much faster. Otherwise, every time we scan for rows to delete we'd re-scan across all the rows that have previously deleted (until the next table VACUUM).
* Improve performance of delete device messages query (#16492)Mathieu Velten2023-10-181-7/+8
|
* Remove useless async job to delete device messages on sync (#16491)Mathieu Velten2023-10-161-2/+3
|
* Convert simple_select_many_batch, simple_select_many_txn to tuples. (#16444)Patrick Cloke2023-10-111-20/+22
|
* Delete device messages asynchronously and in staged batches (#16240)Mathieu Velten2023-09-061-6/+20
|
* Fix appservices being unable to handle to_device messages for multiple users ↵Will Hunt2023-09-051-1/+1
| | | | (#16251)
* to_device updates could be dropped when consuming the replication stream ↵Mathieu Velten2023-03-301-10/+4
| | | | | (#15349) Co-authored-by: reivilibre <oliverw@matrix.org>
* Bump black from 22.12.0 to 23.1.0 (#15103)dependabot[bot]2023-02-221-3/+2
|
* Always notify replication when a stream advances (#14877)Erik Johnston2023-01-201-1/+2
| | | This ensures that all other workers are told about stream updates in a timely manner, without having to remember to manually poke replication.
* Update all stream IDs after processing replication rows (#14723)Nick Mills-Barrett2023-01-041-0/+7
| | | | | | | | | | | | | | This creates a new store method, `process_replication_position` that is called after `process_replication_rows`. By moving stream ID advances here this guarantees any relevant cache invalidations will have been applied before the stream is advanced. This avoids race conditions where Python switches between threads mid way through processing the `process_replication_rows` method where stream IDs may be advanced before caches are invalidated due to class resolution ordering. See this comment/issue for further discussion: https://github.com/matrix-org/synapse/issues/14158#issuecomment-1344048703
* Improve logging and opentracing for to-device message handling (#14598)Richard van der Hoff2022-12-061-17/+75
| | | | | | | A batch of changes intended to make it easier to trace to-device messages through the system. The intention here is that a client can set a property org.matrix.msgid in any to-device message it sends. That ID is then included in any tracing or logging related to the message. (Suggestions as to where this field should be documented welcome. I'm not enthusiastic about speccing it - it's very much an optional extra to help with debugging.) I've also generally improved the data we send to opentracing for these messages.
* Add missing types to opentracing. (#13345)Patrick Cloke2022-07-211-1/+1
| | | After this change `synapse.logging` is fully typed.
* Revert "Make all `process_replication_rows` methods async (#13304)" (#13312)Erik Johnston2022-07-181-4/+2
| | | This reverts commit 5d4028f217f178fcd384d5bfddd92225b4e78c51.
* Make all `process_replication_rows` methods async (#13304)Nick Mills-Barrett2022-07-171-2/+4
| | | | | More prep work for asyncronous caching, also makes all process_replication_rows methods consistent (presence handler already is so). Signed off by Nick @ Beeper (@Fizzadar)
* Replace noop background updates with DELETE. (#12954)Patrick Cloke2022-06-131-11/+0
| | | | Removes the `register_noop_background_update` and deletes the background updates directly in a delta file.
* Add some type hints to datastore (#12485)Dirk Klimpel2022-04-271-23/+56
|
* Reduce to-device queries for /sync. (#12163)Erik Johnston2022-03-041-0/+3
|
* Fix to-device being dropped in limited sync in SQLite. (#11966)Erik Johnston2022-02-111-1/+4
| | | | | | | | | If ther are more than 100 to-device messages pending for a device `/sync` will only return the first 100, however the next batch token was incorrectly calculated and so all other pending messages would be dropped. This is due to `txn.rowcount` only returning the number of rows that *changed*, rather than the number *selected* in SQLite.
* Send to-device messages to application services (#11215)Andrew Morgan2022-02-011-39/+237
| | | Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* Replace uses of simple_insert_many with simple_insert_many_values. (#11742)Patrick Cloke2022-01-131-14/+16
| | | | This should be (slightly) more efficient and it is simpler to have a single method for inserting multiple values.
* Improve type hints in storage classes. (#11652)Dirk Klimpel2021-12-291-2/+2
| | | By using cast and making ignores more specific.
* Type hint the constructors of the data store classes (#11555)Sean Quah2021-12-131-1/+6
|
* Improve performance of `remove_{hidden,deleted}_devices_from_device_inbox` ↵Brendan Abolivier2021-11-251-146/+63
| | | | | (#11421) Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* Add type hints to some storage classes (#11307)Patrick Cloke2021-11-111-16/+36
|
* Clarifications and small fixes to to-device related code (#11247)Andrew Morgan2021-11-091-3/+20
| | | Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
* Delete messages for hidden devices from `device_inbox` (#11199)Dirk Klimpel2021-11-021-0/+89
|
* Stop synapse from saving messages in device_inbox for hidden devices. (#10097)JohannesKleine2021-11-011-2/+6
| | | Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
* Fix comments referencing v1.46.0 from PR #10969. (#11212)Dirk Klimpel2021-10-291-1/+1
| | | | #10969 was merged after 1.46.0rc1 was cut and will be included in v1.47.0rc1 instead.
* Delete messages from `device_inbox` table when deleting device (#10969)Dirk Klimpel2021-10-271-1/+91
| | | Fixes: #9346
* Add type hints for most `HomeServer` parameters (#11095)Sean Quah2021-10-221-3/+6
|
* Remove unnecessary parentheses around tuples returned from methods (#10889)Andrew Morgan2021-09-231-3/+3
|
* [pyupgrade] `synapse/` (#10348)Jonathan de Jong2021-07-191-3/+1
| | | | | | | | | This PR is tantamount to running ``` pyupgrade --py36-plus --keep-percent-format `find synapse/ -type f -name "*.py"` ``` Part of #9744
* Add debug logging for issue #9533 (#9959)Richard van der Hoff2021-05-111-0/+18
| | | | | Hopefully this will help us track down where to-device messages are getting lost/delayed.
* 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 type hints for service notices to the HomeServer object. (#9675)Patrick Cloke2021-03-241-3/+3
|
* Fix some typos.Patrick Cloke2021-02-121-1/+1
|
* Allow moving account data and receipts streams off master (#9104)Erik Johnston2021-01-181-3/+1
|
* Allow running sendToDevice on workers (#9044)Erik Johnston2021-01-071-32/+115
|
* Some cleanups to device inbox store. (#9041)Erik Johnston2021-01-071-49/+58
|
* 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.
* Simplify super() calls to Python 3 syntax. (#8344)Patrick Cloke2020-09-181-2/+2
| | | | | | | This converts calls like super(Foo, self) -> super(). Generated with: sed -i "" -Ee 's/super\([^\(]+\)/super()/g' **/*.py
* Convert additional database code to async/await. (#8195)Patrick Cloke2020-08-281-6/+6
|
* Make StreamIdGen `get_next` and `get_next_mult` async (#8161)Erik Johnston2020-08-251-2/+2
| | | | This is mainly so that `StreamIdGenerator` and `MultiWriterIdGenerator` will have the same interface, allowing them to be used interchangeably.
* Convert account data, device inbox, and censor events databases to ↵Patrick Cloke2020-08-121-45/+49
| | | | async/await (#8063)
* Reduce unnecessary whitespace in JSON. (#7372)David Vo2020-08-071-5/+4
|
* Rename database classes to make some sense (#8033)Erik Johnston2020-08-051-0/+476