You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tree: the reorganization notice keeps reading tree/reorg every 30 s in a hidden window - #3372
plugins/tree/client.js:470 armed 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 kept asking the host for the reorganization report every 30 s for as long as it was mounted, and coming back to the window could show a report up to 30 s stale. plugins/timeline/client.js:70 already declines to poll while visible() is false, and the social and workflow surfaces follow the same rule (#3315, #3327, #3361); this was the tree surface's own poll and the last one that ignored it.
Red first
plugins/tree/test/hidden-poll.test.js (new), run 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.
Fix
pollWhileVisible(fn, ms) (+20/−2): a hidden page arms no interval at all, not one whose tick would be wasted; on visibilitychange back to visible the interval is cleared and re-armed and then read once at once, so the phase does not carry over from before the hidden stretch; the cleanup drops both the timer and the listener.
The notice's effect returns that cleanup instead of owning setInterval/clearInterval. The 30 s cadence while visible and the reorg field-change read are unchanged.
The new test also asserts the unmount half: after unmount no interval is armed and no visibilitychange listener is left.
Ran
TZ=UTC npm --prefix plugins/tree test → 158 tests, 158 pass, 0 fail, 0 skipped (exit 0), at this tip's tree.
Red first: the same command before the fix → 158 tests, 157 pass, 1 fail, original above.
node scripts/lint-plugins.mjs tree → 2 warnings, 0 errors (the baseline count for this package).
node core/scripts/check-arch-docs.mjs with ARCH_DOCS_BASE=bab1fe96 → OK (4 changed files); node .github/scripts/changelog.mjs check → fragments well formed.
Not run / environment
TZ=UTC npm run verify exits 1 at the core suite on one test, core/test/bench-preflight.test.js:88bench.sh shows a failed pnpm install and leaves no half-built profile, reporting mkdir: not found from bench.sh:91. Host layout, not this diff: pnpm and mkdir both live in /usr/bin and the fixture at :119 drops every PATH directory whose name contains pnpm, mkdir included; the same test fails on the base with the change stashed. Every step before the core suite is green.
No UI face: the change is when a read happens, not what the card draws — no before/after screenshots.
Tier: T2 (plugins/** per .github/agent/risk-rules.json) — risk-tier: T2. No UI face.
Checkpoint
{
"pr": 3372, "claim": "Dev-5", "issue": 3371,
"summary": "The Tree panel's reorganization notice read `tree/reorg` from the host every 30 s for as long as it was mounted, hidden window included, and coming back could show a report up to 30 s stale. The read now follows the page: a hidden document arms no interval, returning clears and re-arms it and then reads once at once, and the cleanup drops both the timer and the listener. The visible cadence stays 30 s and the field-change read is untouched.",
"files": ["plugins/tree/client.js", "plugins/tree/test/hidden-poll.test.js", "docs/subsystems/tree.md", "changelog.d/3371.fixed.md"],
"checks": { "ran": "TZ=UTC npm --prefix plugins/tree test; node scripts/lint-plugins.mjs tree; node core/scripts/check-arch-docs.mjs", "result": "green", "at": "4fa0a7d9b8195500ef2ddb8aa422b6f63cf3f9d8" },
"next": "none — ready for review"
}
@Birfy — verdict request for this tip, once: 4fa0a7d9b8195500ef2ddb8aa422b6f63cf3f9d8.
Fixes #3371, base bab1fe963b65913f5cd1021d30e6598a7f571627 (= live main), 4 files +156/−2, maintainer_can_modify: true, non-draft.
At that exact tip: 18 checks = 15 success + 2 skipped (live · real model, window check) + 1 failure — the only red is enqueue-guard (no Verifier report names the tip 4fa0a7d9b819), which is what this request clears. Green: tests-ok, merge-gate, judge, package, plugins (social|timeline|tree|workflow), mock, ubuntu leg, policy-sign, reviewed tip, risk tier.
What it changes, in one line: the tree reorganization notice read tree/reorg on a bare 30 s interval from a hidden window and could be up to 30 s stale on return; it now goes through pollWhileVisible — hidden arms no timer, returning clears and re-arms then reads once at once, and cleanup drops timer and listener.
Red-first evidence in the body: npm --prefix plugins/tree test is 158 / 157 / 1 fail before the fix (a hidden window does not read tree/reorg again, expected 1 actual 2), 158/158/0 after; the new test also asserts after unmount that timers.length === 0 and listeners.length === 0 (the cleanup gap Security flagged on an earlier poll PR); lint-plugins tree 2 warnings / 0 errors (baseline); arch-docs OK (4); changelog check ok.
FlyBot 2.0 audit (2026-11-25), read-only. This PR has no 2.0 landing point, so it was not repackaged; it stays open as the v1.0 record. Nothing was closed, retargeted or merged — the owner decides.
It changes plugins/tree/** + docs: 0 of 4 paths exist at 2.0 main. Tree (recursive bot delegation) is deliberately deferred, not imported (docs/upstream/OPTIONAL-PLUGINS.md:21, planned for multi-agent #6/#7), so the 30-second tree/reorg poll does not exist to guard.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
risk:T2Risk tier T2 (host/plugin code or an unnamed path), set by the controller from the diff
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3371
Owner: Dev-5
Written-by: FlyBot Dev-5
Bot: FlyBot Dev-5
Reviewer: Birfy
What is wrong
plugins/tree/client.js:470armed the reorganization notice's host read as a baresetInterval(load, REFRESH_MS * 3)— 30 s, with no visibility check and novisibilitychangelistener.load()is atree/reorgcall against the host (:463), so a Tree panel left open in a background window kept asking the host for the reorganization report every 30 s for as long as it was mounted, and coming back to the window could show a report up to 30 s stale.plugins/timeline/client.js:70already declines to poll whilevisible()is false, and the social and workflow surfaces follow the same rule (#3315,#3327,#3361); this was the tree surface's own poll and the last one that ignored it.Red first
plugins/tree/test/hidden-poll.test.js(new), run on this branch with the fix not yet written — a hidden document, the notice mounted, then the armed timer fired:After the fix, the same command:
# tests 158 / # pass 158 / # fail 0.Fix
pollWhileVisible(fn, ms)(+20/−2): a hidden page arms no interval at all, not one whose tick would be wasted; onvisibilitychangeback to visible the interval is cleared and re-armed and then read once at once, so the phase does not carry over from before the hidden stretch; the cleanup drops both the timer and the listener.setInterval/clearInterval. The 30 s cadence while visible and thereorgfield-change read are unchanged.visibilitychangelistener is left.Ran
TZ=UTC npm --prefix plugins/tree test→ 158 tests, 158 pass, 0 fail, 0 skipped (exit 0), at this tip's tree.node scripts/lint-plugins.mjs tree→ 2 warnings, 0 errors (the baseline count for this package).node core/scripts/check-arch-docs.mjswithARCH_DOCS_BASE=bab1fe96→ OK (4 changed files);node .github/scripts/changelog.mjs check→ fragments well formed.Not run / environment
TZ=UTC npm run verifyexits 1 at the core suite on one test,core/test/bench-preflight.test.js:88bench.sh shows a failed pnpm install and leaves no half-built profile, reportingmkdir: not foundfrombench.sh:91. Host layout, not this diff:pnpmandmkdirboth live in/usr/binand the fixture at:119drops every PATH directory whose name containspnpm,mkdirincluded; the same test fails on the base with the change stashed. Every step before the core suite is green.Tier: T2 (
plugins/**per.github/agent/risk-rules.json) —risk-tier: T2. No UI face.Checkpoint
{ "pr": 3372, "claim": "Dev-5", "issue": 3371, "summary": "The Tree panel's reorganization notice read `tree/reorg` from the host every 30 s for as long as it was mounted, hidden window included, and coming back could show a report up to 30 s stale. The read now follows the page: a hidden document arms no interval, returning clears and re-arms it and then reads once at once, and the cleanup drops both the timer and the listener. The visible cadence stays 30 s and the field-change read is untouched.", "files": ["plugins/tree/client.js", "plugins/tree/test/hidden-poll.test.js", "docs/subsystems/tree.md", "changelog.d/3371.fixed.md"], "checks": { "ran": "TZ=UTC npm --prefix plugins/tree test; node scripts/lint-plugins.mjs tree; node core/scripts/check-arch-docs.mjs", "result": "green", "at": "4fa0a7d9b8195500ef2ddb8aa422b6f63cf3f9d8" }, "next": "none — ready for review" }