Patrick Cloke
54f8d73c00
Convert additional databases to async/await ( #8199 )
2020-09-01 09:21:48 -04:00
Patrick Cloke
da77520cd1
Convert additional databases to async/await part 2 ( #8200 )
2020-09-01 08:39:04 -04:00
Erik Johnston
bbb3c8641c
Make MultiWriterIDGenerator work for streams that use negative stream IDs ( #8203 )
...
This is so that we can use it for the backfill events stream.
2020-09-01 13:36:25 +01:00
Richard van der Hoff
aa07c37cf0
Move and rename get_devices_with_keys_by_user
( #8204 )
...
* 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`.
2020-09-01 12:41:21 +01:00
Richard van der Hoff
45e8f7726f
Rename get_e2e_device_keys
to better reflect its purpose ( #8205 )
...
... and to show that it does something slightly different to
`_get_e2e_device_keys_txn`.
`include_all_devices` and `include_deleted_devices` were never used (and
`include_deleted_devices` was broken, since that would cause `None`s in the
result which were not handled in the loop below.
Add some typing too.
2020-08-29 00:14:17 +01:00
Andrew Morgan
b4826d6eb1
Fix incorrect return signature
2020-08-28 17:39:48 +01:00
Patrick Cloke
d58fda99ff
Convert event_push_actions
, registration
, and roommember
datastores to async ( #8197 )
2020-08-28 11:34:50 -04:00
Richard van der Hoff
22b926c284
Only return devices with keys from /federation/v1/user/devices/
( #8198 )
...
There's not much point in returning all the others, and some people have a
silly number of devices.
2020-08-28 15:59:28 +01:00
Patrick Cloke
aec7085179
Convert state and stream stores and related code to async ( #8194 )
2020-08-28 09:37:55 -04:00
Patrick Cloke
5c03134d0f
Convert additional database code to async/await. ( #8195 )
2020-08-28 07:54:27 -04:00
Patrick Cloke
b49a5b9307
Convert stats and related calls to async/await ( #8192 )
2020-08-27 17:24:37 -04:00
Patrick Cloke
b71d4a094c
Convert simple_delete to async/await. ( #8191 )
2020-08-27 14:16:41 -04:00
Patrick Cloke
9b7ac03af3
Convert calls of async database methods to async ( #8166 )
2020-08-27 13:38:41 -04:00
Patrick Cloke
c9fa696ea2
simple_search_list_txn should return None, not 0. ( #8187 )
2020-08-27 12:07:13 -04:00
Erik Johnston
5649b7f3d0
Fix missing _add_persisted_position ( #8179 )
...
This was forgotten in #8164 .
2020-08-27 13:20:34 +01:00
Patrick Cloke
30426c7063
Convert additional database methods to async (select list, search, insert_many, delete_*) ( #8168 )
2020-08-27 07:41:01 -04:00
Patrick Cloke
4a739c73b4
Convert simple_update* and simple_select* to async ( #8173 )
2020-08-27 07:08:38 -04:00
Erik Johnston
e3c91a3c55
Make SlavedIdTracker.advance have same interface as MultiWriterIDGenerator ( #8171 )
2020-08-26 13:15:20 +01:00
Patrick Cloke
4c6c56dc58
Convert simple_select_one and simple_select_one_onecol to async ( #8162 )
2020-08-26 07:19:32 -04:00
Erik Johnston
eba98fb024
Add functions to MultiWriterIdGen
used by events stream ( #8164 )
2020-08-25 17:32:30 +01:00
Erik Johnston
2231dffee6
Make StreamIdGen get_next
and get_next_mult
async ( #8161 )
...
This is mainly so that `StreamIdGenerator` and `MultiWriterIdGenerator`
will have the same interface, allowing them to be used interchangeably.
2020-08-25 15:10:08 +01:00
Andrew Morgan
74bf8d4d06
Wording fixes to 'name' user admin api filter ( #8163 )
...
Some fixes to wording I noticed after merging #7377 .
2020-08-25 15:03:24 +01:00
Manuel Stahl
97962ad17b
Search in columns 'name' and 'displayname' in the admin users endpoint ( #7377 )
...
* Search in columns 'name' and 'displayname' in the admin users endpoint
Signed-off-by: Manuel Stahl <manuel.stahl@awesome-technologies.de>
2020-08-25 14:18:14 +01:00
Brendan Abolivier
3f49f74610
Don't fail /submit_token requests on incorrect session ID if request_token_inhibit_3pid_errors is turned on ( #7991 )
...
* Don't raise session_id errors on submit_token if request_token_inhibit_3pid_errors is set
* Changelog
* Also wait some time before responding to /requestToken
* Incorporate review
* Update synapse/storage/databases/main/registration.py
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
* Incorporate review
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
2020-08-24 11:33:55 +01:00
Richard van der Hoff
09fd0eda81
Micro-optimisations to get_auth_chain_ids ( #8132 )
2020-08-21 10:06:45 +01:00
Patrick Cloke
3f91638da6
Allow denying or shadow banning registrations via the spam checker ( #8034 )
2020-08-20 15:42:58 -04:00
Richard van der Hoff
318f4e738e
Be more tolerant of membership events in unknown rooms ( #8110 )
...
It turns out that not all out-of-band membership events are labelled as such,
so we need to be more accepting here.
2020-08-20 16:42:12 +01:00
Patrick Cloke
dbc630a628
Use the JSON encoder without whitespace in more places. ( #8124 )
2020-08-20 10:32:33 -04:00
Patrick Cloke
5eac0b7e76
Add more types to synapse.storage.database. ( #8127 )
2020-08-20 09:00:59 -04:00
Patrick Cloke
76c43f086a
Do not assume calls to runInteraction return Deferreds. ( #8133 )
2020-08-20 06:39:55 -04:00
Richard van der Hoff
12aebdfa5a
Close the database connection we create during startup ( #8131 )
...
... otherwise it gets leaked.
2020-08-19 20:41:53 +01:00
Erik Johnston
c9c544cda5
Remove ChainedIdGenerator
. ( #8123 )
...
It's just a thin wrapper around two ID gens to make `get_current_token`
and `get_next` return tuples. This can easily be replaced by calling the
appropriate methods on the underlying ID gens directly.
2020-08-19 13:41:51 +01:00
Patrick Cloke
eebf52be06
Be stricter about JSON that is accepted by Synapse ( #8106 )
2020-08-19 07:26:03 -04:00
Patrick Cloke
d89692ea84
Convert runWithConnection to async. ( #8121 )
2020-08-19 07:09:24 -04:00
Erik Johnston
76d21d14a0
Separate get_current_token
into two. ( #8113 )
...
The function is used for two purposes: 1) for subscribers of streams to
get a token they can use to get further updates with, and 2) for
replication to track position of the writers of the stream.
For streams with a single writer the two scenarios produce the same
result, however the situation becomes complicated for streams with
multiple writers. The current `MultiWriterIdGenerator` does not
correctly handle the first case (which is not an issue as its only used
for the `caches` stream which nothing subscribes to outside of
replication).
2020-08-19 10:39:31 +01:00
Patrick Cloke
f40645e60b
Convert events worker database to async/await. ( #8071 )
2020-08-18 16:20:49 -04:00
Patrick Cloke
3c01724b33
Fix the return type of send_nonmember_events. ( #8112 )
2020-08-18 09:53:13 -04:00
Patrick Cloke
050e20e7ca
Convert some of the general database methods to async ( #8100 )
2020-08-17 12:18:01 -04:00
Patrick Cloke
ad6190c925
Convert stream database to async/await. ( #8074 )
2020-08-17 07:24:46 -04:00
Patrick Cloke
ac77cdb64e
Add a shadow-banned flag to users. ( #8092 )
2020-08-14 12:37:59 -04:00
Patrick Cloke
b069b78bb4
Convert pusher databases to async/await. ( #8075 )
2020-08-14 10:30:16 -04:00
Patrick Cloke
e8861957d9
Convert receipts and events databases to async/await. ( #8076 )
2020-08-14 10:05:19 -04:00
Patrick Cloke
6b7ce1d332
Remove some unused database functions. ( #8085 )
2020-08-14 09:25:40 -04:00
Patrick Cloke
894dae74fe
Convert misc database code to async ( #8087 )
2020-08-14 07:24:26 -04:00
Patrick Cloke
fbe930dad2
Convert the roommember database to async/await. ( #8070 )
2020-08-12 12:14:34 -04:00
Patrick Cloke
5ecc8b5825
Convert devices database to async/await. ( #8069 )
2020-08-12 10:51:42 -04:00
Patrick Cloke
d68e10f308
Convert account data, device inbox, and censor events databases to async/await ( #8063 )
2020-08-12 09:29:06 -04:00
Patrick Cloke
a3a59bab7b
Convert appservice, group server, profile and more databases to async ( #8066 )
2020-08-12 09:28:48 -04:00
Erik Johnston
6ba621d786
Merge pull request #8060 from matrix-org/erikj/type_server
...
Change HomeServer definition to work with typing.
2020-08-11 22:32:14 +01:00
Patrick Cloke
04faa0bfa9
Convert tags and metrics databases to async/await ( #8062 )
2020-08-11 17:21:20 -04:00