summary refs log tree commit diff
path: root/synapse/storage/databases/main/devices.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Use direct references for some configuration variables (#10798)Patrick Cloke2021-09-131-1/+1
| | | | Instead of proxying through the magic getter of the RootConfig object. This should be more performant (and is more explicit).
* Replace `or_ignore` in `simple_insert` with `simple_upsert` (#10442)Erik Johnston2021-07-221-3/+6
| | | | | | | | Now that we have `simple_upsert` that should be used in preference to trying to insert and looking for an exception. The main benefit is that we ERROR message don't get written to postgres logs. We also have tidy up the return value on `simple_upsert`, rather than having a tri-state of inserted/not-inserted/unknown.
* Combine `LruCache.invalidate` and `invalidate_many` (#9973)Richard van der Hoff2021-05-271-1/+1
| | | | | | | | | | * Make `invalidate` and `invalidate_many` do the same thing ... so that we can do either over the invalidation replication stream, and also because they always confused me a bit. * Kill off `invalidate_many` * changelog
* Remove `keylen` from `LruCache`. (#9993)Richard van der Hoff2021-05-241-1/+1
| | | | | | | `keylen` seems to be a thing that is frequently incorrectly set, and we don't really need it. The only time it was used was to figure out if we had removed a subtree in `del_multi`, which we can do better by changing `TreeCache.pop` to return a different type (`TreeCacheNode`). Commits should be independently reviewable.
* Minor `@cachedList` enhancements (#9975)Richard van der Hoff2021-05-141-1/+1
| | | | | | - use a tuple rather than a list for the iterable that is passed into the wrapped function, for performance - test that we can pass an iterable and that keys are correctly deduped.
* Clear the resync bit after resyncing device lists (#9867)Richard van der Hoff2021-04-221-10/+9
| | | Fixes #9866.
* Remove `synapse.types.Collection` (#9856)Richard van der Hoff2021-04-221-2/+2
| | | This is no longer required, since we have dropped support for Python 3.5.
* 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>`
* remove unused param on `make_tuple_comparison_clause`Richard van der Hoff2021-04-081-1/+1
|
* Update black, and run auto formatting over the codebase (#9381)Eric Eastwood2021-02-161-13/+25
| | | | | | | - 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 execute_batch in more places (#9188)Erik Johnston2021-01-211-2/+2
| | | | | * Use execute_batch in more places * Newsfile
* Add number of local devices to Room Details Admin API (#8886)Dirk Klimpel2020-12-111-0/+32
|
* Replace DeferredCache with LruCache where possible (#8563)Richard van der Hoff2020-10-191-4/+4
| | | Most of these uses don't need a full-blown DeferredCache; LruCache is lighter and more appropriate.
* move DeferredCache into its own moduleRichard van der Hoff2020-10-141-1/+2
|
* Rename Cache->DeferredCacheRichard van der Hoff2020-10-141-2/+2
|
* Move additional tasks to the background worker, part 3 (#8489)Patrick Cloke2020-10-091-95/+101
|
* Add typing information to the device handler. (#8407)Patrick Cloke2020-10-071-3/+3
|
* Add support for MSC2697: Dehydrated devices (#8380)Hubert Chathi2020-10-071-2/+76
| | | | This allows a user to store an offline device on the server and then restore it at a subsequent login.
* Use `async with` for ID gens (#8383)Erik Johnston2020-09-231-3/+3
| | | 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
* Add types to StreamToken and RoomStreamToken (#8279)Erik Johnston2020-09-081-4/+3
| | | The intention here is to change `StreamToken.room_key` to be a `RoomStreamToken` in a future PR, but that is a big enough change without this refactoring too.
* Add cross-signing sigs to the `keys` object (#8234)Richard van der Hoff2020-09-041-9/+3
| | | | | All the callers want this info in the same place, so let's reduce the duplication by doing it here.
* wrap `_get_e2e_device_keys_and_signatures_txn` in a non-txn method (#8231)Richard van der Hoff2020-09-031-3/+1
| | | | | We have three things which all call `_get_e2e_device_keys_and_signatures_txn` with their own `runInteraction`. Factor out the common code.
* Make _get_e2e_device_keys_and_signatures_txn return an attrs (#8224)Richard van der Hoff2020-09-021-4/+4
| | | | this makes it a bit clearer what's going on.
* Rename `_get_e2e_device_keys_txn` (#8222)Richard van der Hoff2020-09-011-2/+2
| | | | | ... to `_get_e2e_device_keys_and_signatures_txn`, to better reflect what it does.
* Convert additional databases to async/await (#8199)Patrick Cloke2020-09-011-20/+18
|
* Move and rename `get_devices_with_keys_by_user` (#8204)Richard van der Hoff2020-09-011-47/+5
| | | | | | | | | | | | | | | | | | * Move `get_devices_with_keys_by_user` to `EndToEndKeyWorkerStore` this seems a better fit for it. This commit simply moves the existing code: no other changes at all. * Rename `get_devices_with_keys_by_user` to better reflect what it does. * get_device_stream_token abstract method To avoid referencing fields which are declared in the derived classes, make `get_device_stream_token` abstract, and define that in the classes which define `_device_list_id_gen`.
* Only return devices with keys from `/federation/v1/user/devices/` (#8198)Richard van der Hoff2020-08-281-3/+1
| | | | | There's not much point in returning all the others, and some people have a silly number of devices.
* Convert calls of async database methods to async (#8166)Patrick Cloke2020-08-271-2/+2
|
* Convert simple_select_one and simple_select_one_onecol to async (#8162)Patrick Cloke2020-08-261-6/+8
|
* Make StreamIdGen `get_next` and `get_next_mult` async (#8161)Erik Johnston2020-08-251-3/+5
| | | | This is mainly so that `StreamIdGenerator` and `MultiWriterIdGenerator` will have the same interface, allowing them to be used interchangeably.
* Convert misc database code to async (#8087)Patrick Cloke2020-08-141-3/+2
|
* Convert devices database to async/await. (#8069)Patrick Cloke2020-08-121-153/+180
|
* Convert directory, e2e_room_keys, end_to_end_keys, monthly_active_users ↵Patrick Cloke2020-08-071-5/+7
| | | | database to async (#8042)
* Reduce unnecessary whitespace in JSON. (#7372)David Vo2020-08-071-6/+5
|
* Rename database classes to make some sense (#8033)Erik Johnston2020-08-051-0/+1311