cheeaun / cheeaun/phanpy

Pagination is broken in timelines

Open
#1,100 6 comments 0 reactions 0 assignees View on GitHub
*key bug help wanted
Dominant language
JavaScript
Stars
1.5k
Forks
186
Avg merge
1d 36m
Merged PRs (30d)
11

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](https://github.com/user-attachments/assets/42e55a92-1835-4461-98f3-8039fa9e5708)

### 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

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.