On the Unread tab the page thinks there is more to load once its items are read #385

Closed
opened 2026-11-04 12:58:01 -08:00 by rays · 2 comments
Owner

Found in the new swipe lines (#384) on 2026-11-04, in the atom feed's Unread tab:

20:54:30 short atom unread 2/2 of 2, more to load
20:54:31 prev  atom unread 2/2 of 2, more to load
20:54:32 short atom unread 1/2 of 0

Both items were loaded and there was nothing more. hasMore() (web/src/items.ts, from #383) is nextOffset() < S.total, and on the Unread tab nextOffset() counts only the loaded items still unread: once they are read it is 0 against the total the server gave when the list was fetched, so it says more. loadAhead then fetches a page that comes back empty, and S.total becomes the server's new unread count, 0, with two items still on screen (the third line), so the list's header can say 0 items beside them.

Harmless to reading, but every swipe near the end of a small Unread list says more to load, which prod-check reads as #383 back, and the page makes a request for nothing.

Fix: decide whether more is left from the last answer itself (the offset asked plus the items it brought, against its total), not from S.total after reads.

$Q logs '{container="iPX"} |= "\"ev\":\"swipe\"" | json | line_format "{{.timestamp}} {{.msg}} {{.feed}} {{.filter}} {{.state}}"' 1h
Found in the new swipe lines (#384) on 2026-11-04, in the atom feed's Unread tab: 20:54:30 short atom unread 2/2 of 2, more to load 20:54:31 prev atom unread 2/2 of 2, more to load 20:54:32 short atom unread 1/2 of 0 Both items were loaded and there was nothing more. hasMore() (web/src/items.ts, from #383) is nextOffset() < S.total, and on the Unread tab nextOffset() counts only the loaded items still unread: once they are read it is 0 against the total the server gave when the list was fetched, so it says more. loadAhead then fetches a page that comes back empty, and S.total becomes the server's new unread count, 0, with two items still on screen (the third line), so the list's header can say 0 items beside them. Harmless to reading, but every swipe near the end of a small Unread list says more to load, which prod-check reads as #383 back, and the page makes a request for nothing. Fix: decide whether more is left from the last answer itself (the offset asked plus the items it brought, against its total), not from S.total after reads. $Q logs '{container="iPX"} |= "\"ev\":\"swipe\"" | json | line_format "{{.timestamp}} {{.msg}} {{.feed}} {{.filter}} {{.state}}"' 1h
rays added the bug label 2026-11-04 12:58:01 -08:00
Author
Owner

More from the swipe lines (#384) since the 2026-11-04 deploy: on Unread the reader's state shows a total below what is loaded, 5/5 of 1, more to load (2026-11-05 02:19, :all) and 2/2 of -1 (2026-11-04 23:33, :all), a negative count. Most end swipes read N/N of 0 (16 of 18), so the total goes to 0 as items are read while the list still holds them. $Q logs '{container="iPX"} |= "\"ev\":\"swipe\"" |= "\"msg\":\"end\"" | json | line_format "{{.timestamp}} {{.feed}} {{.filter}} {{.state}}"' 7d

More from the swipe lines (#384) since the 2026-11-04 deploy: on Unread the reader's state shows a total below what is loaded, `5/5 of 1, more to load` (2026-11-05 02:19, :all) and `2/2 of -1` (2026-11-04 23:33, :all), a negative count. Most `end` swipes read `N/N of 0` (16 of 18), so the total goes to 0 as items are read while the list still holds them. `$Q logs '{container="iPX"} |= "\"ev\":\"swipe\"" |= "\"msg\":\"end\"" | json | line_format "{{.timestamp}} {{.feed}} {{.filter}} {{.state}}"' 7d`
Author
Owner

Fixed in d3b8c4c: whether more is left comes from the last answer itself (its offset plus the items it brought, against its total), so a short Unread list read through no longer asks for an empty page or shows 0 items. Deployed in ipx-web.

Fixed in d3b8c4c: whether more is left comes from the last answer itself (its offset plus the items it brought, against its total), so a short Unread list read through no longer asks for an empty page or shows 0 items. Deployed in ipx-web.
rays closed this issue 2026-11-06 15:51:21 -08:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rays/ipx#385