summary refs log tree commit diff
path: root/synapse/storage/devices.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Prevent multiple device list updates from breaking a batch send (#5156)Andrew Morgan2019-06-061-29/+123
| | | fixes #5153
* Run black on the rest of the storage module (#4996)Amber Brown2019-04-031-127/+98
|
* Fixup slave storesErik Johnston2019-03-041-337/+338
|
* Add unique indexes to a couple of tablesRichard van der Hoff2018-11-021-2/+47
| | | | | The indexes on device_lists_remote_extremeties can be unique, and they therefore should, to ensure that the db remains consistent.
* Remove redundant database locks for device list updatesRichard van der Hoff2018-11-021-5/+40
| | | | We can rely on the application-level per-user linearizer.
* Deduplicate device updates sent over replicationErik Johnston2018-10-291-1/+5
| | | | | | | | | | We currently send several kHz of device list updates over replication occisonally, which often causes the replications streams to lag and then get dropped. A lot of those updates will actually be duplicates, since we don't send e.g. device_ids across replication, so let's deduplicate it when we pull them out of the database.
* Port storage/ to Python 3 (#3725)Amber Brown2018-08-311-5/+5
|
* Fix some looping_call calls which were broken in #3604Richard van der Hoff2018-07-261-1/+1
| | | | | | | | | It turns out that looping_call does check the deferred returned by its callback, and (at least in the case of client_ips), we were relying on this, and I broke it in #3604. Update run_as_background_process to return the deferred, and make sure we return it to clock.looping_call.
* Wrap a number of things that run in the backgroundRichard van der Hoff2018-07-251-2/+6
| | | | | This will reduce the number of "Starting db connection from sentinel context" warnings, and will help with our metrics.
* yes, we do need to invalidate the device_id_exists_cache when deleting a ↵Matthew Hodgson2018-07-191-1/+0
| | | | remote device
* shift to using an explicit deleted flag on m.device_list_update EDUsMatthew Hodgson2018-07-121-8/+10
| | | | and generally make it work.
* WIP to announce deleted devices over federationMatthew Hodgson2018-07-121-12/+28
| | | | | | Previously we queued up the poke correctly when the device was deleted, but then the actual EDU wouldn't get sent, as the device was no longer known. Instead, we now send EDUs for deleted devices too if there's a poke for them.
* run isortAmber Brown2018-07-091-5/+6
|
* Attempt to be more performant on PyPy (#3462)Amber Brown2018-06-281-1/+2
|
* replace some iteritems with sixAdrian Tschira2018-05-191-4/+5
| | | | Signed-off-by: Adrian Tschira <nota@notafile.com>
* Replace ujson with simplejsonErik Johnston2018-03-151-1/+1
|
* Make __init__ consitstent across Store heirarchyRichard van der Hoff2017-11-131-2/+2
| | | | | | Add db_conn parameters to the `__init__` methods of the *Store classes, so that they are all consistent, which makes the multiple inheritance work correctly (and so that we can later extract mixins which can be used in the slavedstores)
* When pruning, delete from device_lists_outbound_last_successErik Johnston2017-06-071-0/+8
|
* Keep pruning background taskErik Johnston2017-06-071-0/+45
|
* Split up device_lists_outbound_pokes table for faster updates.Erik Johnston2017-06-071-58/+24
|
* Add missing yieldsErik Johnston2017-05-081-2/+4
|
* Invalidate cache on device deletionErik Johnston2017-05-081-2/+6
|
* CommentErik Johnston2017-05-081-0/+2
|
* Cache check to see if device existsErik Johnston2017-05-081-1/+12
|
* Add new storage functions for new replicationErik Johnston2017-03-301-3/+3
| | | | | The new replication protocol will keep all the streams separate, rather than muxing multiple streams into one.
* Batch sending of device list pokesErik Johnston2017-03-241-0/+4
|
* User Cursor.__iter__ instead of fetchallErik Johnston2017-03-231-4/+3
| | | | This prevents unnecessary construction of lists
* Fix assertion to stop transaction queue getting wedgedRichard van der Hoff2017-03-151-1/+1
| | | | | | | | ... and update some docstrings to correctly reflect the types being used. get_new_device_msgs_for_remote can return a long under some circumstances, which was being stored in last_device_list_stream_id_by_dest, and was then upsetting things on the next loop.
* Implement _simple_delete_many_txn, use it to delete devicesLuke Barnard2017-03-131-0/+17
| | | | | | (But this doesn't implement the same for deleting access tokens or e2e keys. Also respond to code review.
* Select distinct devices from DBErik Johnston2017-03-061-1/+1
| | | | | Otherwise we might pull out tonnes of duplicate user_ids and this can make synapse sad.
* Fix upErik Johnston2017-03-031-4/+4
|
* Add index to device_lists_streamErik Johnston2017-03-011-0/+7
|
* Clobber old device list stream entriesErik Johnston2017-03-011-0/+10
|
* Fix up txn nameErik Johnston2017-02-281-1/+1
|
* Cache get_user_devices_from_cacheErik Johnston2017-02-271-45/+73
|
* Fix deletion of old sent devices correctlyErik Johnston2017-01-311-5/+17
|
* Only fetch with row ts and count > 1Erik Johnston2017-01-311-1/+2
|
* Fix clearing out old device list outbound pokesErik Johnston2017-01-311-2/+7
|
* Noop device key changes if they're the sameErik Johnston2017-01-301-0/+1
|
* Fix queryErik Johnston2017-01-301-1/+1
|
* Rename funcErik Johnston2017-01-301-1/+1
|
* Clear out old destination pokes.Erik Johnston2017-01-301-0/+42
|
* Always use the latest stream_id, sent or unsentErik Johnston2017-01-301-4/+4
|
* Add ts column to device_lists_outbound_pokesErik Johnston2017-01-271-0/+3
|
* Hook device list updates to replicationErik Johnston2017-01-271-0/+15
|
* CommentErik Johnston2017-01-271-0/+2
|
* SQL param orderingErik Johnston2017-01-271-1/+1
|
* User if rather than forErik Johnston2017-01-271-1/+4
|
* Better nameErik Johnston2017-01-271-1/+1
|
* Remove unused paramErik Johnston2017-01-271-2/+1
|
* Handle users leaving roomsErik Johnston2017-01-261-0/+8
|
* Add commentsErik Johnston2017-01-261-2/+35
|
* Implement device key caching over federationErik Johnston2017-01-261-12/+189
|
* Fix up sending of m.device_list_update edusErik Johnston2017-01-251-20/+20
|
* Add basic implementation of local device list changesErik Johnston2017-01-251-9/+160
|
* Log the types and values when failing to store devicesMark Haines2016-09-071-2/+6
|
* Implement updating devicesRichard van der Hoff2016-07-261-1/+26
| | | | You can update the displayname of devices now.
* Implement deleting devicesRichard van der Hoff2016-07-261-0/+15
|
* GET /devices endpointRichard van der Hoff2016-07-201-1/+21
| | | | | | | 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.
* Add device_id support to /loginRichard van der Hoff2016-07-181-0/+77
Add a 'devices' table to the storage, as well as a 'device_id' column to refresh_tokens. Allow the client to pass a device_id, and initial_device_display_name, to /login. If login is successful, then register the device in the devices table if it wasn't known already. If no device_id was supplied, make one up. Associate the device_id with the access token and refresh token, so that we can get at it again later. Ensure that the device_id is copied from the refresh token to the access_token when the token is refreshed.