mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
Search: Don't disregard grouping info in pagination tokens
This commit is contained in:
parent
af96c6f4d3
commit
27c5e1b374
@ -240,6 +240,15 @@ class SearchHandler(BaseHandler):
|
|||||||
last_event_id = room_events[-1].event_id
|
last_event_id = room_events[-1].event_id
|
||||||
pagination_token = results_map[last_event_id]["pagination_token"]
|
pagination_token = results_map[last_event_id]["pagination_token"]
|
||||||
|
|
||||||
|
# We want to respect the given batch group and group keys so
|
||||||
|
# that if people blindly use the top level `next_batch` token
|
||||||
|
# it returns more from the same group (if applicable) rather
|
||||||
|
# than reverting to searching all results again.
|
||||||
|
if batch_group and batch_group_key:
|
||||||
|
global_next_batch = encode_base64("%s\n%s\n%s" % (
|
||||||
|
batch_group, batch_group_key, pagination_token
|
||||||
|
))
|
||||||
|
else:
|
||||||
global_next_batch = encode_base64("%s\n%s\n%s" % (
|
global_next_batch = encode_base64("%s\n%s\n%s" % (
|
||||||
"all", "", pagination_token
|
"all", "", pagination_token
|
||||||
))
|
))
|
||||||
|
Loading…
Reference in New Issue
Block a user