summary refs log tree commit diff
path: root/synapse/streams/events.py
diff options
context:
space:
mode:
authorBenjamin Kampmann <ben.kampmann@gmail.com>2022-11-24 09:10:51 +0000
committerGitHub <noreply@github.com>2022-11-24 09:10:51 +0000
commitf6c74d1cb2ed966802b01a2b037f09ce7a842c18 (patch)
tree38fc186fc69fb64eae7fab8dbabfb90a84fd2daa /synapse/streams/events.py
parentRemove legacy Prometheus metrics names. They were deprecated in Synapse v1.69... (diff)
downloadsynapse-f6c74d1cb2ed966802b01a2b037f09ce7a842c18.tar.xz
Implement message forward pagination from start when no from is given, fixes #12383 (#14149)
Fixes https://github.com/matrix-org/synapse/issues/12383
Diffstat (limited to 'synapse/streams/events.py')
-rw-r--r--synapse/streams/events.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/synapse/streams/events.py b/synapse/streams/events.py
index f331e1af16..619eb7f601 100644
--- a/synapse/streams/events.py
+++ b/synapse/streams/events.py
@@ -74,6 +74,19 @@ class EventSources:
         return token
 
     @trace
+    async def get_start_token_for_pagination(self, room_id: str) -> StreamToken:
+        """Get the start token for a given room to be used to paginate
+        events.
+
+        The returned token does not have the current values for fields other
+        than `room`, since they are not used during pagination.
+
+        Returns:
+            The start token for pagination.
+        """
+        return StreamToken.START
+
+    @trace
     async def get_current_token_for_pagination(self, room_id: str) -> StreamToken:
         """Get the current token for a given room to be used to paginate
         events.