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: 49cd871f1fb4453abeed702ad9115122
Branch: dev/5-workflow-hidden-poll
Base: bab1fe9
At: 2026-11-24T08:28:20Z
Written-by: FlyBot Lead
Bot: FlyBot Dev-5
What is wrong
plugins/workflow/client.js:2197 arms the stage's store poll as a bare setInterval(() => { ... void refresh() }, 2000) — no visibility check, and no listener for visibilitychange. refresh() is a full workflow/state read of the store (:2106, heldLimit widening included), so a Workflow stage left open in a background window — a second window, a minimised app, a tab behind another — keeps reading the host every 2 s for as long as any run is live (activeCount > 0) or a read error is on screen. On live main bab1fe963b65913f5cd1021d30e6598a7f571627 this is the one place in the plugin set that does not follow the page: plugins/timeline/client.js:70 already declines to poll while visible() is false, and the social surface has the same rule (#3315, #3327).
The other half of the same defect: coming back to the window shows rows up to 2 s stale, because nothing reads at the moment the page becomes visible again.
Both are the same line of code, so one fix covers them. This is not #1564 (that removed a second effect and made one tick one read) and not the social polls.
Expected behaviour
- Hidden page: the stage arms no interval at all, so no tick reads the store.
- 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 leave the phase running from before the hidden stretch and put the next read early.
- Visible: unchanged 2000 ms cadence, and unloading the section removes the listener and the interval.
- Nothing else changes: one read per tick, a failed read still arms its retry, and the read-only answer still suppresses the write path (
#2222).
Red first
plugins/workflow/test/client.test.js on this branch, with the fix not yet written — a hidden document, a live run, then the armed timer fired:
not ok 249 - a hidden page stops the poll and a visible one reads again at once
error: |-
a hidden page does not read the store again
2 !== 1
expected: 1
actual: 2
# tests 545
# pass 544
# fail 1
The same test after the fix: # tests 545 / # pass 545 / # fail 0.
Scope
plugins/workflow/client.js— onepollWhileVisible(fn, ms)helper and the two lines of the effect that use it (+30/−3).plugins/workflow/test/client.test.js— the case above on the existing timer stub (+52).docs/subsystems/workflow.md— one sentence on the client row.changelog.d/<this issue>.fixed.md.
No UI face: the change is when a poll runs, not what the panel draws, so there are no before/after screenshots. plugins/social/** untouched (#3315, #3327 are that face).
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 for this face: visibilitychange workflow (6 hits), hidden poll (56), workflow poll 2s (4). Every hit is social (#3315, #3327, #3332–#3356) or the older one-tick-one-read fix #1564/#1565. No issue names plugins/workflow/client.js's own poll.
Activity
Birfy commentedon Nov 25, 2026
基于已退役布局关闭(关闭原因,非验收结论)
d8898cad(2026-11-25T12:20:16Z,2156 blobs)d8898cad上不存在