Repository navigation
Description
Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment on this issue.
Written-by: FlyBot Lead
Claimed-by: FlyBot Lead
Claim-Id: 6d31499800f64a45bf1bb0081658f902
Branch: dev/3-peer-thinking-poll
Base: 1a276c5
At: 2026-11-23T14:46:32Z
Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment.
Written-by: FlyBot Lead
Bot: FlyBot Dev-3
What happens now
The peer-thinking row (PeerThinking, plugins/social/client.js:2489) polls social/typing every 2 s with setInterval(load, 2000) created unconditionally at mount; the "tab is hidden" test sits inside load (:2484), so while the tab is hidden the timer keeps firing and each tick returns early — and no visibilitychange listener exists in that component, so coming back to the tab waits up to 2 s for the next tick instead of reading at once.
This is the same shape #3327 fixed for the paused-chat card and the connecting settings page; that PR's body lists this row as a follow-up candidate.
Reproduction on live main 1a276c57874e3c45680d4bec10ae1bd6080777fd
cd plugins/social && node --import ./test/resolve.mjs --test test/poll-visibility.test.js
Red first, same command twice, identical: # tests 7 / # pass 6 / # fail 1
not ok 7 - the peer-thinking row stops while hidden and reads once when the tab returns
error: 'a hidden row holds no poll timer'
actual: [ 2000 ] expected: []
at plugins/social/test/poll-visibility.test.js:275
The second half of the same case (drop the timer assertion in a scratch copy) fails with coming back made 0 read(s), not one — the current code has no visibility listener at all.
Expected behaviour
While the tab is hidden the row holds no poll timer and issues no social/typing read; when the tab becomes visible it reads immediately once and restarts the 2 s cadence from that read; unmounting removes the timer and the listener. The visible cadence and everything on screen stay exactly as they are.
Verified fix
Same shape as #3327: drop the document.hidden early return from load, const stop = pollWhileVisible(load, 2000), and on unmount live = false; stop?.(). plugins/social/client.js +2/−6, plus one line in docs/subsystems/social.md and changelog.d/<N>.fixed.md.
Readings at that fix, same base: file 7/7 (# fail 0); npm --prefix plugins/social test 768/768 (base baseline 767/767, so only the new case is added); node scripts/lint-plugins.mjs social Found 42 warnings and 0 errors.; changelog 8 fragment(s) … well formed; ARCH_DOCS_BASE=1a276c57… check-arch-docs → arch-docs: OK (3 changed file(s)).
Scope
- Lane:
plugins/social/client.js+plugins/social/test/poll-visibility.test.js+docs/subsystems/social.md+ one changelog fragment. Nocore/**, nosrc/**, nopatches/**, no client bundle, no generated file. - No UI face: the row's text, when it appears and its layout do not change; only when reads happen while hidden changes. No screenshots needed.
- The other same-shape poll points (
FaceRooms,FriendsBots,ManageAccess,ShareWithFriend,ChatApprovalDock, the 30 s status timer) stay out of this issue.
Duplicate check
Grepped live main for PeerThinking, peer-thinking, social/typing, pollWhileVisible; searched issues and PRs for PeerThinking, peer-thinking, social/typing hidden poll. Only adjacent, all closed and none reporting the hidden-tab behaviour: #443 (origin of the row), #297, #3327 (the paused-chat card and settings page). No open or closed issue covers this row's hidden-tab polling.
Activity
social: the peer-thinking row stops polling while the tab is hidden a…