You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently when you GET /_matrix/client/v3/rooms/{room_id}/state/m.room.create?format=event (notice the event format), it doesn't include event_id which is kinda annoying to work with and reference.
Currently, we use format_event_for_client_v2(data.get_dict()) against the EventBase PDU JSON dictionary which doesn't include event_id. We could instead use serialize_event(data, self.clock.time_msec()) which would get us something more workable.
We could also alternatively, add event_id to the dictionary returned by EventBase.get_dict() but that probably has too many downstream side-effects like messing with the PDU JSON serialization stuff.
This issue has been migrated from #15454.
Problem
Currently when you
GET /_matrix/client/v3/rooms/{room_id}/state/m.room.create?format=event
(notice the event format), it doesn't includeevent_id
which is kinda annoying to work with and reference.Example:
Proposal
Add
event_id
to the output. There is no spec to go off of but seems like a non-breaking change we can do.Spawning from a need in matrix-org/matrix-viewer#167 to get the
event_id
of them.room.create
event in the room.Is there a better way to do this? Perhaps
/_matrix/client/v3/rooms/{room_id}/messages?dir=f&limit=1
Dev notes
?format
query parameter: Spec?format=event|content
onGET /state/:type[/:key]
matrix-org/matrix-spec#1047?format
introduced to Synapse in Allow clients to ask for the whole of a single state event matrix-org/synapse#1094Relevant code:
https://github.com/matrix-org/synapse/blob/d935b806a52c967543f59def690aec0fa873d13c/synapse/rest/client/room.py#L258-L262
Currently, we use
format_event_for_client_v2(data.get_dict())
against theEventBase
PDU JSON dictionary which doesn't includeevent_id
. We could instead useserialize_event(data, self.clock.time_msec())
which would get us something more workable.We could also alternatively, add
event_id
to the dictionary returned byEventBase.get_dict()
but that probably has too many downstream side-effects like messing with the PDU JSON serialization stuff.https://github.com/matrix-org/synapse/blob/d935b806a52c967543f59def690aec0fa873d13c/synapse/events/__init__.py#L362-L366
Separately, it would be good to standardize with the
?event_format=client|federation
parameter used with other endpointsThe text was updated successfully, but these errors were encountered: