-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Send canonicaljson in response to federation requests #2967
Conversation
This reverts commit 120c238.
Can one of the admins verify this patch? |
1 similar comment
Can one of the admins verify this patch? |
Closes #2951 |
For the record, the only reason for not merging this has been concerns over the performance of |
Wait, this changes the response for all federation APIs. matrix-org/matrix-doc#1013 only discussed the format of events on the wire. The two seem only loosely related - what am I missing? |
If the message has to be signed and verified as canonical JSON then the wire message should be canonical JSON. If there's an expectation of non-canonical JSON for any message, well, wouldn't you think this whole exercise is kind of pointless then? Perhaps @ara4n thought events should be canonical without considering |
Right, but the responses to federation API requests isn't one of those places. Perhaps I'm missing something, but I don't see the need for canonicaljson here. |
So pretty much what you're saying is to go around and make sure every PDU being sent is sorted JSON but then somehow Is that even possible for you? I don't think it is. And this is to avoid the sorting of, as a common example, two pystring references I'm pretty sure you want a simple and uniform method of output without trying to grotesquely optimize it by sorting some parts and not others. Otherwise, you'd be me. |
So I guess the answer to "Perhaps I'm missing something" is simply "this seems the simplest way to make sure that the events returned by /federation/v1/event and friends are sent as canonical json". However:
Well, in theory we could use
Well, my concern is more about responses which contain a whole tree of objects, all of which need sorting. And irrespective of sorting, |
@richvdh canonicaljson was updated to 1.1.x, can this now be merged? I'm unsure how bad the performance of canonicaljson is, but if need be, I can reimplement it in C so we'll be done thinking about performance on that matter. |
Also, I created a proposal to enforce this in the spec, matrix-org/matrix-spec-proposals#2102 |
Due to inactivity I'm going to close this PR. Is it still necessary after the changes to ujson, simplejson, etc.? If it is, please rebase and reopen this PR! |
This reverts commit 120c238.
Signed-off-by: Jason Volk [email protected]