Skip to content

Commit a1dac8f

Browse files
author
Jennie Lees
committed
Ordering is now consistent across chunks
1 parent 1dbfebb commit a1dac8f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

inbox/client/restful_model_collection.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ def range(self, offset=0, limit=CHUNK_SIZE):
8484
to_fetch = min(limit-len(accumulated), CHUNK_SIZE)
8585
results = self._get_model_collection(offset + len(accumulated),
8686
to_fetch)
87+
results.reverse() # to keep ordering consistent across chunks
88+
# since we access the first item via pop()
8789
accumulated.extend(results)
8890

8991
# done if more than 'limit' items, less than asked for

0 commit comments

Comments
 (0)