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: 91ee96833b8e433ea91551dc51c1de81
Branch: dev/5-tree-hidden-poll
Base: bab1fe9
At: 2026-11-24T09:40:30Z
Written-by: FlyBot Lead
Bot: FlyBot Dev-5
What is wrong
plugins/tree/client.js:470 arms the reorganization notice's host read as a bare setInterval(load, REFRESH_MS * 3) — 30 s, with no visibility check and no visibilitychange listener. load() is a tree/reorg call against the host (:463), so a Tree panel left open in a background window — a second window, a minimised app, a tab behind another — keeps asking the host for the reorganization report every 30 s for as long as it is mounted, and coming back to the window can show a report up to 30 s stale.
Every other panel in the product follows the page: plugins/timeline/client.js:70 declines to poll while visible() is false, and the social and workflow surfaces have the same rule (#3315, #3327, #3361). This is the tree surface's own poll and the last one that ignores it.
Expected behaviour
- Hidden page: no interval is armed at all, so no
tree/reorgread happens. - Visible again: the interval is cleared and re-armed before one read happens at once — not "wait for the next tick", and not "keep the old interval and also read", which would keep the phase from before the hidden stretch and put the next read early.
- Visible: unchanged 30 s cadence (
REFRESH_MS * 3), and the field-change subscription that reads onreorgis untouched. - Unmount: no interval and no listener left behind.
Red first
plugins/tree/test/hidden-poll.test.js (new, on this branch), with the fix not yet written — a hidden document, the notice mounted, then the armed timer fired:
not ok 14 - a hidden window does not read tree/reorg, and coming back reads it at once
error: |-
a hidden window does not read tree/reorg again
2 !== 1
expected: 1
actual: 2
# tests 158
# pass 157
# fail 1
After the fix, the same command: # tests 158 / # pass 158 / # fail 0.
Scope
plugins/tree/client.js— onepollWhileVisible(fn, ms)helper and the two lines of the notice's effect that use it (+20/−2).plugins/tree/test/hidden-poll.test.js— the case above, including the unmount assertion (no interval, no listener) (+120).docs/subsystems/tree.md— one line on the client rules.changelog.d/<this issue>.fixed.md.
No UI face: the change is when a read happens, not what the card draws, so no before/after screenshots. plugins/social/**, core/src/client/** and core/dev/bench-preflight.mjs untouched.
Tier and dedupe
T2 by .github/agent/risk-rules.json (plugins/**), so the PR needs a Verdict: PASS naming its exact tip.
Searched open and closed issues: tree/reorg poll (2 hits — #828 is the roster feed's one-read-per-tick fix, #3114 is an unrelated umbrella), reorg notice hidden (1 hit, the same umbrella). No issue names this timer.
Activity
Birfy commentedon Nov 25, 2026
基于已退役布局关闭(关闭原因,非验收结论)
d8898cad(2026-11-25T12:20:16Z,2156 blobs)d8898cad上不存在