summary refs log tree commit diff
path: root/tests/storage/test_devices.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Prepare unit tests for Python 3.12 (#16099)V024602023-08-251-9/+9
|
* Require types in tests.storage. (#14646)Patrick Cloke2022-12-091-10/+25
| | | | Adds missing type hints to `tests.storage` package and does not allow untyped definitions.
* Track unconverted device list outbound pokes using a position instead (#14516)Sean Quah2022-11-221-2/+1
| | | | | | | | | | | | | | | | | | | | | When a local device list change is added to `device_lists_changes_in_room`, the `converted_to_destinations` flag is set to `FALSE` and the `_handle_new_device_update_async` background process is started. This background process looks for unconverted rows in `device_lists_changes_in_room`, copies them to `device_lists_outbound_pokes` and updates the flag. To update the `converted_to_destinations` flag, the database performs a `DELETE` and `INSERT` internally, which fragments the table. To avoid this, track unconverted rows using a `(stream ID, room ID)` position instead of the flag. From now on, the `converted_to_destinations` column indicates rows that need converting to outbound pokes, but does not indicate whether the conversion has already taken place. Closes #14037. Signed-off-by: Sean Quah <seanq@matrix.org>
* Additional constants for EDU types. (#12884)Patrick Cloke2022-05-271-2/+5
| | | Instead of hard-coding strings in many places.
* Mark remote device list updates as already handled (#12557)Erik Johnston2022-04-261-1/+1
|
* Only send out device list updates for our own users (#12465)Erik Johnston2022-04-141-3/+3
| | | Broke in #12365
* Process device list updates asynchronously (#12365)Erik Johnston2022-04-121-20/+27
|
* Track device list updates per room. (#12321)Erik Johnston2022-04-041-4/+10
| | | | | | | | | | | | | | This is a first step in dealing with #7721. The idea is basically that rather than calculating the full set of users a device list update needs to be sent to up front, we instead simply record the rooms the user was in at the time of the change. This will allow a few things: 1. we can defer calculating the set of remote servers that need to be poked about the change; and 2. during `/sync` and `/keys/changes` we can avoid also avoid calculating users who share rooms with other users, and instead just look at the rooms that have changed. However, care needs to be taken to correctly handle server downgrades. As such this PR writes to both `device_lists_changes_in_room` and the `device_lists_outbound_pokes` table synchronously. In a future release we can then bump the database schema compat version to `69` and then we can assume that the new `device_lists_changes_in_room` exists and is handled. There is a temporary option to disable writing to `device_lists_outbound_pokes` synchronously, allowing us to test the new code path does work (and by implication upgrading to a future release and downgrading to this one will work correctly). Note: Ideally we'd do the calculation of room to servers on a worker (e.g. the background worker), but currently only master can write to the `device_list_outbound_pokes` table.
* 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
* Fix a bug introduced in Synapse v1.50.0rc1 whereby outbound federation could ↵reivilibre2022-01-131-1/+111
| | | | | fail because too many EDUs were produced for device updates. (#11730) Co-authored-by: David Robertson <davidr@element.io>
* Fix a bug introduced in Synapse v1.0.0 whereby device list updates would not ↵reivilibre2022-01-121-1/+49
| | | | | be sent to remote homeservers if there were too many to send at once. (#11729) Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
* 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>`
* Convert storage test cases to HomeserverTestCase. (#9736)Patrick Cloke2021-04-061-48/+32
|
* Add number of local devices to Room Details Admin API (#8886)Dirk Klimpel2020-12-111-0/+26
|
* 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
* Convert simple_select_one and simple_select_one_onecol to async (#8162)Patrick Cloke2020-08-261-4/+4
|
* Convert devices database to async/await. (#8069)Patrick Cloke2020-08-121-15/+29
|
* Remove handling of multiple rows per IDErik Johnston2020-02-281-45/+0
|
* rename get_devices_by_remote to get_device_updates_by_remoteHubert Chathi2019-10-301-6/+6
|
* fix unit testHubert Chathi2019-10-221-1/+3
|
* Run Black. (#5482)Amber Brown2019-06-201-8/+8
|
* Prevent multiple device list updates from breaking a batch send (#5156)Andrew Morgan2019-06-061-0/+69
| | | fixes #5153
* Run tests under PostgreSQL (#3423)Amber Brown2018-08-131-1/+1
|
* Run black.black2018-08-101-37/+32
|
* run isortAmber Brown2018-07-091-0/+1
|
* Implement updating devicesRichard van der Hoff2016-07-261-0/+36
| | | | You can update the displayname of devices now.
* Fix PEP8 errorsRichard van der Hoff2016-07-201-2/+0
|
* GET /devices endpointRichard van der Hoff2016-07-201-0/+71
implement a GET /devices endpoint which lists all of the user's devices. It also returns the last IP where we saw that device, so there is some dancing to fish that out of the user_ips table.