mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-12-15 19:08:43 -05:00
Do not return unspecced original_event field when using the stable /relations endpoint. (#14025)
Keep the old behavior (of including the original_event field) for any requests to the /unstable version of the endpoint, but do not include the field when the /v1 version is used. This should avoid new clients from depending on this field, but will not help with current dependencies.
This commit is contained in:
parent
d42541733d
commit
b706111b78
4 changed files with 28 additions and 17 deletions
|
|
@ -654,6 +654,14 @@ class RelationsTestCase(BaseRelationsTestCase):
|
|||
)
|
||||
|
||||
# We also expect to get the original event (the id of which is self.parent_id)
|
||||
# when requesting the unstable endpoint.
|
||||
self.assertNotIn("original_event", channel.json_body)
|
||||
channel = self.make_request(
|
||||
"GET",
|
||||
f"/_matrix/client/unstable/rooms/{self.room}/relations/{self.parent_id}?limit=1",
|
||||
access_token=self.user_token,
|
||||
)
|
||||
self.assertEqual(200, channel.code, channel.json_body)
|
||||
self.assertEqual(
|
||||
channel.json_body["original_event"]["event_id"], self.parent_id
|
||||
)
|
||||
|
|
@ -755,11 +763,6 @@ class RelationPaginationTestCase(BaseRelationsTestCase):
|
|||
channel.json_body["chunk"][0],
|
||||
)
|
||||
|
||||
# We also expect to get the original event (the id of which is self.parent_id)
|
||||
self.assertEqual(
|
||||
channel.json_body["original_event"]["event_id"], self.parent_id
|
||||
)
|
||||
|
||||
# Make sure next_batch has something in it that looks like it could be a
|
||||
# valid token.
|
||||
self.assertIsInstance(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue