-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Synapse implementation of MSC2946 Spaces Server-server API is against spec? #10056
Comments
It looks like gomatrixserverlib has a bogus declaration for its request structure. We can see in the code that only gomatrixserverlib.MSC2946SpacesRequest{
Limit: w.req.Limit,
MaxRoomsPerSpace: w.req.MaxRoomsPerSpace
}
The right fix should be to add a |
Add the `omitempty` annotation to `MSC2946SpacesRequest.ExcludeRooms` and `MSC2946SpacesRequest.MaxRoomsPerSpace` as MSC2946 states these are optional parameters (and keeping them around with their zero value might lead to type errors when interacting with other homeservers). See matrix-org/synapse#10056 for more context.
Add the `omitempty` annotation to `MSC2946SpacesRequest.ExcludeRooms` and `MSC2946SpacesRequest.MaxRoomsPerSpace` as MSC2946 states these are optional parameters (and keeping them around with their zero value might lead to type errors when interacting with other homeservers). See matrix-org/synapse#10056 for more context.
I've opened matrix-org/gomatrixserverlib#259 to fix it on Dendrite/gomatrixserverlib. Since this issue isn't related to Synapse (and the gomatrixserverlib PR has been merged while I was writing this), I'm closing this issue. Thanks for reporting it! |
Description
Synapse fails to respond to a Spaces Summary request from Dendrite and returns
M_BAD_JSON: bad value for 'exclude_rooms'
instead.According to the specification
exclude_rooms
is an optional field.ref. https://github.com/matrix-org/matrix-doc/pull/2946/files
Dendrite currently only sends
suggested_only
andmax_rooms_per_space
fields on the request.ref: https://github.com/matrix-org/dendrite/blob/a7f2845a6a97af0c1855eb3c8d81cb4ca348d176/setup/mscs/msc2946/msc2946.go#L416
Steps to reproduce
How to circumvent
Add empty
exclude_rooms
list to the outgoing JSON request on Dendrite:After adding the empty list to the request, synapse will respond to the request as intended.
Suggested fix
Do not require
exclude_rooms
on synapse's side, or propose a change of spec if it should be needed. The other optional fields might currently be required by the synapse implementation as well.ref. for code on exclude_rooms:
synapse/synapse/federation/transport/server.py
Lines 1418 to 1422 in 3e831f2
Version information
Encountered against:
The text was updated successfully, but these errors were encountered: