Skip to content
Snippets Groups Projects
Commit c43d8981 authored by Kegan Dougal's avatar Kegan Dougal
Browse files

SYN-178: Fix off by one.

parent d8fcc4e0
No related branches found
No related tags found
No related merge requests found
...@@ -284,8 +284,12 @@ class StreamStore(SQLBaseStore): ...@@ -284,8 +284,12 @@ class StreamStore(SQLBaseStore):
rows.reverse() # As we selected with reverse ordering rows.reverse() # As we selected with reverse ordering
if rows: if rows:
topo = rows[0]["topological_ordering"] # XXX: Always subtract 1 since the start token always goes
toke = rows[0]["stream_ordering"] # backwards (parity with paginate_room_events). It isn't
# obvious that this is correct; we should clarify the algorithm
# used here.
topo = rows[0]["topological_ordering"] - 1
toke = rows[0]["stream_ordering"] - 1
start_token = "t%s-%s" % (topo, toke) start_token = "t%s-%s" % (topo, toke)
token = (start_token, end_token) token = (start_token, end_token)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment