dendrite icon indicating copy to clipboard operation
dendrite copied to clipboard

The transaction_id within events is not serialised in many endpoints

Open sandhose opened this issue 1 year ago • 3 comments

Similar to https://github.com/matrix-org/synapse/issues/15173 in Synapse

There are many endpoints that return events, and in those representations they should include the transaction_id in the unsigned part of the event.

I wrote a Complement test to highlight that Synapse had this issue by testing using the /rooms/{roomId}/event/{eventId} endpoint, and Dendrite also fails on this test. I haven't tested the other endpoints, nor covered them in the Complement test. https://github.com/matrix-org/complement/pull/621

sandhose avatar Mar 06 '23 16:03 sandhose

I'd be interested in taking a shot at this, would it be possible for someone to point me in the right direction in terms of the serialization code and behavior?

abheekda1 avatar Mar 28 '23 19:03 abheekda1

For a starting point: This method gets the events for e.g. /search or the mentioned /rooms/{roomId}/event/{eventId} but doesn't have a device parameter we could pass to StreamEventsToEvents which does the "magic" with transaction_id.

Almost the same is happening for /messages in handleNonEmptyEventsSlice, where we also don't pass a device to StreamEventsToEvents

/context seems to be a little bit trickier, as the database queries don't return StreamEvents.

S7evinK avatar Mar 29 '23 07:03 S7evinK

This doesn't seem to have any activity since March so I'm going to have a stab at it. I've got the Complement test passing, but haven't checked any other endpoints yet.

tmills80 avatar Feb 12 '24 22:02 tmills80