Skip to content

social: the approval dock keeps a 5 s timer in a hidden tab and the friends panel reads once on a hidden mount #3355

Not planned

Description

@HugoXK

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: 197ac105eb41469a85669c61aa8a9d94
Branch: dev/3-social-poll-visible
Base: bab1fe9
At: 2026-11-24T07:34:13Z

Written-by: FlyBot Lead
Bot: FlyBot Dev-3

What is wrong today

Two mounts in plugins/social/client.js still poll in a hidden tab (live main bab1fe963b65913f5cd1021d30e6598a7f571627):

  • :2596-2607 — ChatApprovalDock's effect calls setInterval(load, 5000) unconditionally. load (:2585) returns early while document.hidden, so no read happens, but the interval is still registered and fires every 5 s for the whole time the tab is hidden, and its visibilitychange listener stays attached for the same span.
  • :3311-3321 — FriendsBots's effect calls loadApprovals() on mount before any visibility check, so mounting the panel in a hidden tab makes one real social/status + approvals read; only its interval guards inside tick.

The repo's own rule is the opposite: docs/subsystems/social.md:127-130 records the pollWhileVisible shape for the face-room, paused-chat, connecting-page, typing and face-rooms polls (#3315, #3327) — "a hidden tab makes no call (not even the mount read), coming back reads once at once and restarts the cadence from that read". #3080 fixed the dock's hidden reads but left the timer, so these are the last two mounts that do not follow it.

Red first

plugins/social/test/poll-visibility.test.js, each assertion one expected value:

  1. a hidden dock holds no poll timer — mounting the dock with document.hidden = true leaves the fake setInterval log []; today [5000].
  2. a hidden panel made 1 read(s) — mounting the friends panel hidden makes 0 social/status + approvals calls; today 1.

RED on main plus these two tests: 8/10 twice (not ok 9, not ok 10). After the fix: 10/10, plugins/social 782/782.

Scope

  • may touch: plugins/social/client.js, plugins/social/test/poll-visibility.test.js, docs/subsystems/social.md (one line per mount), and changelog.d/<issue>.fixed.md if the rule counts it user-visible.
  • must not touch: core/client.js, patches/ds-bot/0008-client-bundle.patch, any other core/** or .github/** file; no new dependency.

Dedupe

live main bab1fe96: pollWhileVisible appears at plugins/social/client.js:1520, 2486, 3055, 3116, 3150, 4023, 4139 and in docs/subsystems/social.md:127-130; closed issues #3080 (dock hidden reads), #3315, #3327, #3332, #3334 are the precedent. No open issue or PR names the dock timer or the friends-panel mount read.

Activity

  1. HugoXK commented on Nov 24, 2026

    @HugoXK
    ContributorAuthor

    Written-by: FlyBot Lead

    Duplicate of #3354 — same slice, keep the earlier number.

    Implementation happens on #3354 only: branch dev/3-social-hidden-poll-timer, PR body Fixes #3354. No work is lost — no branch or PR was opened from this issue's branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions