Skip to content

Make use of since_id param in timelines#413

Open
mkljczk wants to merge 1 commit intofedify-dev:mainfrom
mkljczk:timelines-since-id
Open

Make use of since_id param in timelines#413
mkljczk wants to merge 1 commit intofedify-dev:mainfrom
mkljczk:timelines-since-id

Conversation

@mkljczk
Copy link
Copy Markdown
Contributor

@mkljczk mkljczk commented Mar 27, 2026

It appears to work correctly on my instance

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
@dahlia dahlia self-assigned this Mar 27, 2026
@dahlia dahlia added the enhancement New feature or request label Mar 27, 2026
@dahlia dahlia added this to the Hollo 0.8 milestone Mar 27, 2026
Copy link
Copy Markdown
Member

@dahlia dahlia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution again!

Comment on lines 196 to 199
const nextMaxId =
timeline.length >= query.limit ? timeline[timeline.length - 1].id : null;
const nextLink = nextMaxId == null ? undefined : new URL(c.req.url);
nextLink?.searchParams.set("max_id", nextMaxId ?? "");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forward pagination still breaks for min_id requests.

The query now returns the oldest matching newer statuses first, but the Link header below still builds only rel="next" from max_id=<oldest returned> while preserving the original min_id.

For a full page, the follow-up request becomes:

  • id > min_id
  • id < oldest_returned

That range is immediately empty, so clients cannot page past the first batch of newer statuses.

Please build forward-pagination links for min_id requests here as well. This affects /public, /home, /list/:list_id, and /tag/:hashtag.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Didn’t spot this because my main use case for since_id (polling for new statuses) doesn’t utilize link headers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants