mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-14 04:55:22 -04:00
Merge branch 'release-v1.55' into develop
This commit is contained in:
commit
3f7cfbc9e5
67 changed files with 126 additions and 66 deletions
|
@ -981,6 +981,34 @@ class RelationsTestCase(BaseRelationsTestCase):
|
|||
[annotation_event_id_good, thread_event_id],
|
||||
)
|
||||
|
||||
def test_bundled_aggregations_with_filter(self) -> None:
|
||||
"""
|
||||
If "unsigned" is an omitted field (due to filtering), adding the bundled
|
||||
aggregations should not break.
|
||||
|
||||
Note that the spec allows for a server to return additional fields beyond
|
||||
what is specified.
|
||||
"""
|
||||
self._send_relation(RelationTypes.ANNOTATION, "m.reaction", "a")
|
||||
|
||||
# Note that the sync filter does not include "unsigned" as a field.
|
||||
filter = urllib.parse.quote_plus(
|
||||
b'{"event_fields": ["content", "event_id"], "room": {"timeline": {"limit": 3}}}'
|
||||
)
|
||||
channel = self.make_request(
|
||||
"GET", f"/sync?filter={filter}", access_token=self.user_token
|
||||
)
|
||||
self.assertEqual(200, channel.code, channel.json_body)
|
||||
|
||||
# Ensure the timeline is limited, find the parent event.
|
||||
room_timeline = channel.json_body["rooms"]["join"][self.room]["timeline"]
|
||||
self.assertTrue(room_timeline["limited"])
|
||||
parent_event = self._find_event_in_chunk(room_timeline["events"])
|
||||
|
||||
# Ensure there's bundled aggregations on it.
|
||||
self.assertIn("unsigned", parent_event)
|
||||
self.assertIn("m.relations", parent_event["unsigned"])
|
||||
|
||||
|
||||
class RelationPaginationTestCase(BaseRelationsTestCase):
|
||||
def test_basic_paginate_relations(self) -> None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue