diff options
author | Erik Johnston <erik@matrix.org> | 2020-09-10 16:10:01 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2020-09-10 16:10:01 +0100 |
commit | d9a29506b6b2e68aeafeff6ca2ef003792194448 (patch) | |
tree | e775c83dda4209e636afbb85c5de72b81ff15168 /synapse/replication/tcp/client.py | |
parent | Newsfile (diff) | |
download | synapse-d9a29506b6b2e68aeafeff6ca2ef003792194448.tar.xz |
Add EventStreamPosition type github/erikj/stream_position erikj/stream_position
Diffstat (limited to 'synapse/replication/tcp/client.py')
-rw-r--r-- | synapse/replication/tcp/client.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/synapse/replication/tcp/client.py b/synapse/replication/tcp/client.py index e82b9e386f..55af3d41ea 100644 --- a/synapse/replication/tcp/client.py +++ b/synapse/replication/tcp/client.py @@ -29,7 +29,7 @@ from synapse.replication.tcp.streams.events import ( EventsStreamEventRow, EventsStreamRow, ) -from synapse.types import UserID +from synapse.types import PersistedEventPosition, RoomStreamToken, UserID from synapse.util.async_helpers import timeout_deferred from synapse.util.metrics import Measure @@ -151,8 +151,14 @@ class ReplicationDataHandler: extra_users = () # type: Tuple[UserID, ...] if event.type == EventTypes.Member: extra_users = (UserID.from_string(event.state_key),) - max_token = self.store.get_room_max_stream_ordering() - self.notifier.on_new_room_event(event, token, max_token, extra_users) + + max_token = RoomStreamToken( + None, self.store.get_room_max_stream_ordering() + ) + event_pos = PersistedEventPosition(instance_name, token) + self.notifier.on_new_room_event( + event, event_pos, max_token, extra_users + ) # Notify any waiting deferreds. The list is ordered by position so we # just iterate through the list until we reach a position that is |