oliver-zehentleitner / maity

clean-up: web messages/ticker: one paged feed that follows next_cursor

Sign in to report

tsk-5q6vkgn4syh6 Open

From the web clean-up audit, area 17 (tsk-hgnbapyw7hnh), read at 80647565 (findings sent to lotse, seq 125512). Line numbers are from 80647565, so re-check them on current main.

#37 Messages / Ticker: the paging and live-update machinery is copied, with different stop rules (duplication/design).

  • Where: messages.js:82-260 (load :194, live :242, the loop stops when next is empty at :257) and ticker.js:132-262 (load :192, live :230, the loop stops when a page is shorter than PAGE at :242).
  • Both carry the same state and logic: gen, resetting, liveAgain, loaded, fresh, mark, fillEmpty, drawMore, LIVE_PAGES.
  • Messages follows next_cursor. Ticker ignores it and stops on a short page. That works today only because the ticker listing has no scan budget (hub ticker.py:605-630), and it breaks silently if one is added.
  • Contract section 1.4 says next_cursor is null on the last page.
  • Proposal: one M.pagedFeed({query, item, list, ...}) that always follows next_cursor, used by both views.
  • Effort M. Risk medium: both views have intricate focus and race handling that smoke covers.