SYN-104: When going backwards the end token should be before the last event

This commit is contained in:
Mark Haines 2014-11-18 16:44:52 +00:00
parent 11fd81e398
commit 1731af3f29

View File

@ -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.