summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2014-11-18 16:44:52 +0000
committerMark Haines <mark.haines@matrix.org>2014-11-18 16:45:06 +0000
commit1731af3f29d21fc9ff69166c79391573c7a9a60e (patch)
treec5ea275c4df52ed29e9aa17b5e8999b8143f59e0 /synapse/storage
parentMerge pull request #17 from matrix-org/room-initial-sync (diff)
downloadsynapse-1731af3f29d21fc9ff69166c79391573c7a9a60e.tar.xz
SYN-104: When going backwards the end token should be before the last event
Diffstat (limited to '')
-rw-r--r--synapse/storage/stream.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/synapse/storage/stream.py b/synapse/storage/stream.py
index 475e7f20a1..a954024678 100644
--- a/synapse/storage/stream.py
+++ b/synapse/storage/stream.py
@@ -253,6 +253,9 @@ class StreamStore(SQLBaseStore):
         if rows:
             topo = rows[-1]["topological_ordering"]
             toke = rows[-1]["stream_ordering"]
+            if direction == 'b':
+                topo -= 1
+                toke -= 1
             next_token = "t%s-%s" % (topo, toke)
         else:
             # TODO (erikj): We should work out what to do here instead.