Description
Currently, when viewing Hollo timelines using certain Mastodon clients like SubwayTooter, the "gap-loading" feature (fetching missing posts between already loaded posts) does not work correctly.
I tested this in my local fork and confirmed that applying the following changes makes gap-loading work properly. I propose incorporating these changes to improve overall usability.
Note on AI Usage:
The code for these changes was generated with the assistance of AI. Because of this, I am not entirely sure if it is the most accurate or optimal approach for the Hollo codebase. I would greatly appreciate it if the maintainers could review the implementation.
Proposed Changes
-
Mastodon-compliant min_id handling for timelines:
- Fixed the
min_id behavior in timeline endpoints (/api/v1/timelines/home, /public, /list/:list_id, /tag/:hashtag) to match Mastodon's pagination logic.
- When
min_id is provided, the query now fetches the posts immediately above the cursor (by switching ORDER BY to ASC and then reversing the results back to DESC). This allows gap loading to properly converge when the gap is larger than the limit.
- When both
min_id and since_id are provided, the API now ignores since_id (matching Mastodon's behavior).
-
Restored timeline pagination links (Link headers):
- Fixed the timeline endpoints to properly generate and expose the
prev/next Link headers required for gap-loading navigation.
Expected Behavior
When fetching timelines from clients that support gap-loading (such as SubwayTooter), users should be able to load missing posts continuously without skipping any items between older and newer posts.
Description
Currently, when viewing Hollo timelines using certain Mastodon clients like SubwayTooter, the "gap-loading" feature (fetching missing posts between already loaded posts) does not work correctly.
I tested this in my local fork and confirmed that applying the following changes makes gap-loading work properly. I propose incorporating these changes to improve overall usability.
Note on AI Usage:
The code for these changes was generated with the assistance of AI. Because of this, I am not entirely sure if it is the most accurate or optimal approach for the Hollo codebase. I would greatly appreciate it if the maintainers could review the implementation.
Proposed Changes
Mastodon-compliant
min_idhandling for timelines:min_idbehavior in timeline endpoints (/api/v1/timelines/home,/public,/list/:list_id,/tag/:hashtag) to match Mastodon's pagination logic.min_idis provided, the query now fetches the posts immediately above the cursor (by switchingORDER BYtoASCand then reversing the results back toDESC). This allows gap loading to properly converge when the gap is larger than thelimit.min_idandsince_idare provided, the API now ignoressince_id(matching Mastodon's behavior).Restored timeline pagination links (
Linkheaders):prev/nextLink headers required for gap-loading navigation.Expected Behavior
When fetching timelines from clients that support gap-loading (such as SubwayTooter), users should be able to load missing posts continuously without skipping any items between older and newer posts.