Commit Graph

21 Commits

Author SHA1 Message Date
Erik Johnston
888a29f412
Wait for lazy join to complete when getting current state () 2022-06-01 16:02:53 +01:00
Patrick Cloke
1885ee0113
Remove unstable APIs for /hierarchy. ()
Removes the unstable endpoint as well as a duplicated field
which was modified during stabilization.
2022-05-26 07:10:28 -04:00
David Robertson
81d9f2a8e9
Fixes to MSC3787 implementation () 2022-05-24 16:50:50 +00:00
Travis Ralston
942c30b16b
Add a new room version for MSC3787's knock+restricted join rule () 2022-05-17 10:41:39 +00:00
DeepBlueV7.X
a377a43386
Support MSC3266 room summaries over federation ()
Signed-off-by: Nicolas Werner <nicolas.werner@hotmail.de>
2022-05-05 15:25:00 +01:00
Patrick Cloke
ca9234a9eb
Do not return allowed_room_ids from /hierarchy response. ()
This field is only to be used in the Server-Server API, and not the
Client-Server API, but was being leaked when a federation response
was used in the /hierarchy API.
2022-03-08 08:09:11 -05:00
Patrick Cloke
1103c5fe8a
Check if instances are lists, not sequences. ()
As a str is a sequence, the checks were not granular
enough and would allow lists or strings, when only
lists were valid.
2022-03-02 13:18:51 +00:00
Patrick Cloke
7754af24ab
Remove the unstable /spaces endpoint. ()
...and various code supporting it.

The /spaces endpoint was from an old version of MSC2946 and included
both a Client-Server and Server-Server API. Note that the unstable
/hierarchy endpoint (from the final version of MSC2946) is not yet
removed.
2022-02-28 18:33:00 +00:00
Richard van der Hoff
e24ff8ebe3
Remove HomeServer.get_datastore() ()
The presence of this method was confusing, and mostly present for backwards
compatibility. Let's get rid of it.

Part of 
2022-02-23 11:04:02 +00:00
Sean Quah
af13a3be29
Fix a bug that corrupted the cache of federated space hierarchies ()
`FederationClient.get_room_hierarchy()` caches its return values, so
refactor the code to avoid modifying the returned room summary.
2022-01-20 11:03:42 +00:00
Patrick Cloke
8e57584a58
Support spaces with > 50 rooms in the /hierarchy endpoint. ()
By returning all of the m.space.child state of the space, not just
the first 50. The number of rooms returned is still capped at 50.

For the federation API this implies that the requesting server will
need to individually query for any other rooms it is not joined to.
2022-01-07 19:27:58 -05:00
Travis Ralston
feb3e006d7
Fix space hierarchy endpoint to match MSC2946 ()
Fixes minor discrepancies between the /hierarchy endpoint described
in MSC2946 and the implementation.

Note that the changes impact the stable and unstable /hierarchy and
unstable /spaces endpoints for both client and federation APIs.
2022-01-05 20:33:43 +00:00
Patrick Cloke
a4521ce0a8
Support the stable /hierarchy endpoint from MSC2946 ()
This also makes additional updates where the implementation
had drifted from the approved MSC.

Unstable endpoints will be removed at a later data.
2021-11-29 14:32:20 -05:00
Sean Quah
88375beeaa
Avoid sharing room hierarchy responses between users ()
Different users may be allowed to see different rooms within a space,
so sharing responses between users is inadvisable.
2021-11-16 15:40:47 +00:00
Andrew Morgan
aa2c027792
Remove unnecessary parentheses around tuples returned from methods () 2021-09-23 11:59:07 +01:00
Patrick Cloke
b3590614da
Require type hints in the handlers module. ()
Adds missing type hints to methods in the synapse.handlers
module and requires all methods to have type hints there.

This also removes the unused construct_auth_difference method
from the FederationHandler.
2021-09-20 08:56:23 -04:00
Patrick Cloke
a23f3abb9b
Return stripped m.space.child events via the space summary. ()
The full event content cannot be trusted from this API (as no auth
chain, etc.) is processed over federation. Returning the full event
content was a bug as MSC2946 specifies that only the stripped
state should be returned.

This also avoids calculating aggregations / annotations which go
unused.
2021-09-07 08:43:54 -04:00
Patrick Cloke
c586d6803a
Ignore rooms with unknown room versions in the spaces summary. ()
This avoids breaking the entire endpoint if a room with
an unsupported room version is encountered.
2021-09-01 17:01:08 +00:00
Patrick Cloke
6258730ebe
Consider the origin_server_ts of the m.space.child event when ordering rooms. ()
This updates the ordering of the returned events from the spaces
summary API to that defined in MSC2946 (which updates MSC1772).

Previously a step was skipped causing ordering to be inconsistent with
clients.
2021-09-01 12:59:52 -04:00
Patrick Cloke
d12ba52f17
Persist room hierarchy pagination sessions to the database. () 2021-08-24 08:14:03 -04:00
Michael Telatynski
0ace38b7b3
Experimental support for MSC3266 Room Summary API. () 2021-08-16 14:49:12 +00:00