cheeaun/phanpy

Pagination is broken in timelines

Open

#1,100 opened on Mar 23, 2025

View on GitHub
 (6 comments) (0 reactions) (0 assignees)JavaScript (173 forks)github user discovery
*keybughelp wanted

Repository metrics

Stars
 (1,453 stars)
PR merge metrics
 (PR metrics pending)

Description

Site

phanpy.social, and when running locally in dev mode

Version

2025.03.22.85d964f, and on latest main branch

Instance

enby.life

Browser

  • Firefox 136.0.2 on Windows 11
  • Edge 134.0.3124.83 on Windows 11

Bug description

Timeline pagination does not work - Phanpy always stops with "The end." and refuses to scroll further. Testing with a debugger shows that the API response includes pagination headers and Phanpy understands them correctly, resulting in a call to setShowMore(true). This would enable pagination, but for some reason the loadItems callback is immediately fired a second time, hitting the else condition which includes setShowMore(false). Thus, the flag is reset to false and the timeline does not scroll. I'm not exactly sure why this is happening, but it seems like maybe useDebouncedCallback isn't working correctly?

To reproduce

  1. Go to the Home or Federated timeline. Others may work, but these are the two I tested most closely.
  2. Scroll down. The timeline will stop after one page and disable "The end.", despite the presence of more posts and correct pagination headers from the server API.

Image

Expected behavior

The timeline should have continued to the next page of posts.

Other

I've been testing with a Sharkey instance, which uses an API translation layer for Mastodon support. This could (and does) cause some bugs, but I can't see how it would cause this particular bug. The pagination behavior matches mastodon and I've personally verified the API responses coming from the server.

Contributor guide