Merge branch 'madlittlemods/fix-and-tests-for-get_last_event_in_room_before_stream_ordering' into madlittlemods/msc3575-sliding-sync-sort

Conflicts:
	synapse/storage/databases/main/stream.py
	tests/storage/test_stream.py
This commit is contained in:
Eric Eastwood 2024-06-11 22:40:08 -05:00
commit 03547b09e3
3 changed files with 3 additions and 4 deletions

1
changelog.d/17295.bugfix Normal file
View file

@ -0,0 +1 @@
Fix edge case in `/sync` returning the wrong the state when using sharded event persisters.

View file

@ -931,8 +931,6 @@ class StreamWorkerStore(EventsWorkerStore, SQLBaseStore):
# ordering of the operand queries but there is no actual gurantee that it
# has this behavior in all scenarios so we need the extra `ORDER BY` at the
# bottom.
#
# We're using the subquery syntax for SQLite compatibility.
sql = """
SELECT * FROM (
SELECT instance_name, stream_ordering, topological_ordering, event_id

View file

@ -468,7 +468,7 @@ class GetLastEventInRoomBeforeStreamOrderingTestCase(HomeserverTestCase):
self.assertEqual(
last_event,
event_response3["event_id"],
f"We expected {event_response3["event_id"]} but saw {last_event} which corresponds to"
f"We expected {event_response3['event_id']} but saw {last_event} which corresponds to "
+ str(
{
"event1": event_response1["event_id"],
@ -526,7 +526,7 @@ class GetLastEventInRoomBeforeStreamOrderingTestCase(HomeserverTestCase):
self.assertEqual(
last_event,
event_response2["event_id"],
f"We expected {event_response2["event_id"]} but saw {last_event} which corresponds to"
f"We expected {event_response2['event_id']} but saw {last_event} which corresponds to "
+ str(
{
"event1": event_response1["event_id"],