1
0
Commit Graph

19740 Commits

Author SHA1 Message Date
David Robertson
6c7aecd67f Use _clock again and note the typing problem 2021-11-24 12:35:19 +00:00
David Robertson
4686190945 SlavedEventStore doesn't need StreamWorkerStore
already has it via SlavedEventStore -> BaseEventStore ->
CacheInvalidationWorkerStore -> StreamWorkerStore
2021-11-18 18:48:08 +00:00
David Robertson
e5d15cc677 Fix typo 2021-11-18 18:42:56 +00:00
David Robertson
1138f18cde Use _clock; weaken StatsStore to StateDeltasStore
And while we're at it, StatsStore doesn't needs its own clock attribute.
2021-11-18 18:42:43 +00:00
David Robertson
dfe4779f43 Fixup portdb script
Being honest I just tried to do the minimal thing possible to get it to
work.
2021-11-16 18:47:57 +00:00
David Robertson
7f6c2aab57 Fixup imports 2021-11-16 18:47:57 +00:00
David Robertson
ee1803551d Mypy now passes. 2021-11-16 18:47:46 +00:00
David Robertson
13b9509e76 Pull in RoomMemberWorkerStore
for get_rooms_for_user_with_stream_ordering.

This was the most painful MRO problem to resolve.

Remove BaseSlavedStore and SlavedEventStore from
GenericWorkerSlavedStore. These are already pulled in indirectly by
inheriting from SlavedPushRuleStore.
2021-11-16 18:46:52 +00:00
David Robertson
ea34499c9b Pull in StatsStore
I need StateDeltasStore for _curr_state_delta_stream_cache.
I also need the `clock` attribute, which pathologically only seems to be
defined on StatsStore. StatsStore is a subclass of StateDeltasStore, so
let's just use that to keep the list of parents minimal.

To be explicit: I think it's very very odd that only StatsStore provides
a `clock`. I think pulling it in here is silly: why should
CacheInvalidationWorkerStore care about stats? Consider this a protest
commit to raise attention to the bizarre status quo.
2021-11-16 18:46:52 +00:00
David Robertson
d251ab8785 Cache needs StreamWorkerStore
for _membership_stream_cache
2021-11-16 18:46:51 +00:00
David Robertson
0e7d79b61d Pull in EventPushActionsWorkerStore 2021-11-16 18:46:51 +00:00
David Robertson
1dea20ca75 CacheInvalidationWorkerStore needs RelationsWorkerStore
for e.g. get_relations_for_event.

Remove it from SlavedEventsStore. (Still there via SlavedEventsStore ->
BaseSlavedStore -> CacheInvalidationWorkerStore -> RelationsWorkerStore.
2021-11-16 18:46:51 +00:00
David Robertson
58c20bbcb7 LoggingDatabaseConnection.__enter__ returns itself
Could use a fancy TypeVar here but I restrained myself.
2021-11-16 18:46:51 +00:00
David Robertson
f7111a9805 mark _cache_id_gen as a required mixin property 2021-11-16 18:46:47 +00:00
David Robertson
9a316ecd3c SCARY: Pull in EventFederationWorkerStore
for e.g. get_latest_event_ids_in_room

Needed on CacheInvalidationWorkerStore for many functions, e.g.
`have_seen_event`.

Fixup MRO in CensorEventsStore.

The BaseSlavedStore is trickier. The removals should be safe because the
removed classes are in parents, via SlavedEventStore -> BaseSlavedStore
-> CacheInvalidationWorkerStore
2021-11-16 11:49:11 +00:00
David Robertson
e140beeb56 Easier function annotations 2021-11-16 11:48:45 +00:00
David Robertson
bb150be1ad Annotate get_all_updates_caches_txn 2021-11-15 13:00:04 +00:00
David Robertson
e605e4b8f2 Database storage profile passes mypy (#11342)
It already seems to pass mypy. I wonder what changed, given that it was
on the exclusion list. So this commit consists of me ensuring
`--disallow-untyped-defs` passes and a minor fixup to a function that
returned either `True` or `None`.
2021-11-15 12:59:33 +00:00
David Robertson
5562ce6a53 Get directory db file to pass mypy (#11339) 2021-11-15 12:59:05 +00:00
Tulir Asokan
6f862c5c28 Add support for the stable version of MSC2778 (#11335)
* Add support for the stable version of MSC2778

Signed-off-by: Tulir Asokan <tulir@maunium.net>

* Expect m.login.application_service in login and password provider tests

Signed-off-by: Tulir Asokan <tulir@maunium.net>
2021-11-15 10:31:22 +00:00
Shay
605921bc6b Remove unused tables room_stats_historical and user_stats_historical (#11280)
* remove unused tables room_stats_historical and user_stats_historical

* update changelog number

* Bump schema compat version comment

* make linter happy

* Update comment to give more info

Co-authored-by: reivilibre <oliverw@matrix.org>

Co-authored-by: reivilibre <oliverw@matrix.org>
2021-11-12 16:47:56 -08:00
David Robertson
fe58672546 Annotations for state_deltas.py (#11316)
I was sad that I couldn't do better for
`_curr_state_delta_stream_cache`. At least it's explicitly called out in
a comment with #TODO.
2021-11-12 20:24:12 +00:00
Patrick Cloke
3fad4e3fe5 Rollback #11322 due to wrong syntax in mypy.ini. (#11332)
This was only checking the __init__ files in modules instead of
all files in a module, which don't pass yet.
2021-11-12 20:10:03 +00:00
David Robertson
bea815cec8 Test room alias deletion (#11327)
* Prefer `HTTPStatus` over plain `int`

This is an Opinion that no-one has seemed to object to yet.

* `--disallow-untyped-defs` for `tests.rest.client.test_directory`
* Improve synapse's annotations for deleting aliases
* Test case for deleting a room alias
* Changelog
2021-11-12 19:56:00 +00:00
Shay
0bcae8ad56 Change display names/avatar URLs to None if they contain null bytes before storing in DB (#11230)
* change display names/avatar URLS to None if they contain null bytes

* add changelog

* add POC test, requested changes

* add a saner test and remove old one

* update test to verify that display name has been changed to None

* make test less fragile
2021-11-12 10:38:24 -08:00
Patrick Cloke
9b90b9454b Add type hints to media repository storage module (#11311) 2021-11-12 11:05:26 -05:00
David Robertson
6f8f3d4bc5 Attempt to annotate events_forward_extremities (#11314)
* Make DataStore inherit from EventForwardExtremitiesStore before CacheInvalidationWorkerStore

the former implicitly inherits from the latter, so they should be
ordered like this when used.
2021-11-12 15:58:17 +00:00
David Robertson
4c96ce396e Misc typing fixes for tests, part 1 of N (#11323)
* Annotate HomeserverTestCase.servlets
* Correct annotation of federation_auth_origin
* Use AnyStr custom_headers instead of a Union

This allows (str, str) and (bytes, bytes).
This disallows (str, bytes) and (bytes, str)

* DomainSpecificString.SIGIL is a ClassVar
2021-11-12 15:50:54 +00:00
Patrick Cloke
95547e5300 Generalize the disallowed_untyped_defs in mypy.ini (#11322) 2021-11-12 14:27:45 +00:00
Patrick Cloke
b64b6d12d4 Add more type hints to synapse.util. (#11321) 2021-11-12 13:43:06 +00:00
reivilibre
2fffcb24d8 Suggest using /etc/matrix-synapse/conf.d/ for configuration with Debian packages (#11281) 2021-11-12 13:17:06 +00:00
Dirk Klimpel
8840a7b7f1 Convert delete room admin API to async endpoint (#11223)
Signed-off-by: Dirk Klimpel dirk@klimpel.org
2021-11-12 12:35:31 +00:00
David Robertson
c99da2d079 Annotations for user_erasure_store (#11313)
I'm not sure why this was excluded---it seemed to be passing for me. But
it's easy enough to fixup.
2021-11-11 19:22:19 +00:00
David Robertson
6a605f4a77 Get db signatures file to pass mypy (#11312) 2021-11-11 17:04:44 +00:00
David Robertson
8dc666f785 Correct type hint for room_batch.py (#11310)
Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
2021-11-11 16:49:28 +00:00
Dirk Klimpel
48278a0d09 Move sql file for remove_deleted_devices_from_device_inbox into v65 (#11303) 2021-11-11 15:01:13 +00:00
Patrick Cloke
64ef25391d Add type hints to some storage classes (#11307) 2021-11-11 08:47:31 -05:00
Neeeflix
6ce19b94e8 Fix error in thumbnail generation (#11288)
Signed-off-by: Jonas Zeunert <jonas@zeunert.org>
2021-11-10 20:49:43 +00:00
Patrick Cloke
5cace20bf1 Add missing type hints to synapse.app. (#11287) 2021-11-10 15:06:54 -05:00
Patrick Cloke
66c4b774fd Add type hints to synapse._scripts (#11297) 2021-11-10 17:55:32 +00:00
Andrew Morgan
5f277ffe89 Add documentation page stubs for Single Sign-On, SAML and CAS pages (#11298) 2021-11-10 17:54:56 +00:00
Richard van der Hoff
73cbb284b9 Remove redundant parameters on _check_event_auth (#11292)
as of #11012, these parameters are unused.
2021-11-10 14:16:06 +00:00
Olivier Wilkinson (reivilibre)
68c258a604 Merge tag 'v1.47.0rc2' into develop
Synapse 1.47.0rc2 (2021-11-10)
==============================

This fixes an issue with publishing the Debian packages for 1.47.0rc1.
It is otherwise identical to 1.47.0rc1.
2021-11-10 13:01:08 +00:00
Olivier Wilkinson (reivilibre)
595f28529c Changelog tweak from feedback v1.47.0rc2 2021-11-10 09:54:34 +00:00
Olivier Wilkinson (reivilibre)
ef7f9286d1 Move Debian changelog entries to rc2 since rc1 was not published 2021-11-10 09:48:50 +00:00
Olivier Wilkinson (reivilibre)
82e62b488a 1.47.0rc2 2021-11-10 09:44:38 +00:00
Olivier Wilkinson (reivilibre)
af6374905a Correct the Debian changelog 2021-11-10 09:37:48 +00:00
Stanislav Motylkov
b09d90cac9 Fix typos in the username_available admin API documentation. (#11286) 2021-11-09 21:11:05 +00:00
Eric Eastwood
f1d5c2f269 Split out federated PDU retrieval into a non-cached version (#11242)
Context: https://github.com/matrix-org/synapse/pull/11114/files#r741643968
2021-11-09 15:07:57 -06:00
Patrick Cloke
0ef69ddbdc Ignore missing imports for parameterized. (#11285)
This was due to a conflict between #11282, which changed
mypy configuration, and #11228, a normal change.
2021-11-09 19:04:53 +00:00