-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Implement message forward pagination from start when no from is given, fixes #12383 #14149
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fix #12383: paginate room messages from the start if no from is given. Contributed by @gnunicorn . | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -448,6 +448,12 @@ async def get_messages( | |
|
||
if pagin_config.from_token: | ||
from_token = pagin_config.from_token | ||
elif pagin_config.direction == "f": | ||
from_token = ( | ||
await self.hs.get_event_sources().get_start_token_for_pagination( | ||
room_id | ||
) | ||
) | ||
Comment on lines
+452
to
+456
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if this should clamp to the user's join or just let them get filtered out? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Although I guess that depends on history visibility, so likely doesn't make sense to add that complexity here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have no idea how visibility is managed right now, isn't that happening in the filtering later? That's how I understood the requesting part... If you think this isn't properly covered I can look into adding a test that ensure we are doing this right... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fairly sure the visibility should already be getting filtered later, otherwise you could already read messages you're not supposed to by crafting the start token yourself. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @reivilibre I read that right as "no other changes needed"? |
||
else: | ||
from_token = ( | ||
await self.hs.get_event_sources().get_current_token_for_pagination( | ||
|
Uh oh!
There was an error while loading. Please reload this page.