Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Federation 'send_join' response has extraneous [200, $data] wrapping (SYN-490) #1383

Closed
matrixbot opened this issue Sep 25, 2015 · 6 comments
Labels
z-bug (Deprecated Label) z-p4 (Deprecated Label)

Comments

@matrixbot
Copy link
Member

Hard to say if this is an impl. or a spec bug as the make_join / send_join API is completely undocumented, so for now I'm reporting it as an impl bug.

The JSON response body to a send_join request arrives with an extra layer of wrapping, being placed into a list with the number 200 in the first position and the actual event data in the second. I believe this comes from the implementation having

defer.returnValue((200, content))

style code in it twice; once at

defer.returnValue((200, {

and once again at

defer.returnValue((200, content))

(Imported from https://matrix.org/jira/browse/SYN-490)

(Reported by @leonerd)

@matrixbot
Copy link
Member Author

Jira watchers: @leonerd

@matrixbot
Copy link
Member Author

As a solution: I imagine one of these wants removing, though this would change the on-the-wire- format of join messages. We'd have to first ensure that that the federation client can accept a response in either format (which should be a trivial test of the toplevel container type), and additionally publish some sort of announcement for developers of other homeservers to adapt it suitably.

Or maybe ignore it for v1 and fix that in federation v2?

-- @leonerd

@matrixbot
Copy link
Member Author

Conclusion: So much other stuff in federation needs fixing that we'll have to adopt a "v2" sometime anyway. So we'll just ignore this for now and treat it as a v1 quirk (much like HTTP 1.1's "referer" header)

-- @leonerd

@matrixbot
Copy link
Member Author

Also the /invite API

-- @leonerd

@matrixbot matrixbot added z-p4 (Deprecated Label) z-bug (Deprecated Label) labels Nov 7, 2016
@matrixbot matrixbot changed the title Federation 'send_join' response has extraneous [200, $data] wrapping (SYN-490) Federation 'send_join' response has extraneous [200, $data] wrapping (https://github.com/matrix-org/synapse/issues/1383) Nov 7, 2016
@matrixbot matrixbot changed the title Federation 'send_join' response has extraneous [200, $data] wrapping (https://github.com/matrix-org/synapse/issues/1383) Federation 'send_join' response has extraneous [200, $data] wrapping (SYN-490) Nov 7, 2016
@turt2live
Copy link
Member

For future adventurers: The PR that added this to the spec is here: matrix-org/matrix-spec-proposals#143

Worth noting is the fix is scheduled for v2 as per matrix-org/matrix-spec-proposals@f6c5597

@richvdh
Copy link
Member

richvdh commented Jan 21, 2019

well, I guess this is now baked into the spec, so is no longer a synapse bug, and is superceded by matrix-org/matrix-spec-proposals#1418.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
z-bug (Deprecated Label) z-p4 (Deprecated Label)
Projects
None yet
Development

No branches or pull requests

3 participants