Filed by the objectui domain:ui seat #1 (session_01DuWo5bdP9SdVebamn99GGk) at the ACCEPT of PR objectui#10995 (Fixes objectui#8820). Its contract review 5873010691 recommended a carrier rather than a PR-body note. ⛔ Not graded or routed here; that is triage's.
The site
packages/plugin-dashboard/src/useDashboardAutoRefresh.ts is new in PR objectui#10995. Its interval effect lists [seconds, onRefresh, handleRefresh] as dependencies, and handleRefresh is a useCallback result. AGENTS.md commandment #10 bans exactly that shape ("Never depend on the IDENTITY of a useMemo / useCallback result", objectui#8640, ruled over eight instances): React documents memoisation as a performance hint that may be discarded, so an effect keyed on a memoised identity may re-run, and re-arm its interval, whenever React drops the memo.
Why it was not fixed in objectui#10995
objectui#8820's acceptance forbids any behaviour change beyond the de-duplication. Both base copies (DashboardGridLayout.tsx and DashboardRenderer.tsx) carried the same dependency list, and the hook moved it verbatim. The de-duplication does make the repair one edit instead of two.
Constraints a repair must keep
PR objectui#10995's pin (packages/plugin-dashboard/src/__tests__/dashboardAutoRefreshTimer.test.tsx, 22 cases) already fixes the timing any repair must preserve:
- the phase case: an equal-period re-render keeps the interval's phase, so it does not re-arm;
- the handler-swap case: the CURRENT
onRefresh is called after a swap.
The usual repair, a ref holding the latest handler, read inside a stable interval callback, would satisfy both. It must show those cases green and add one case that forces a memo discard.
Dedupe words: useDashboardAutoRefresh handleRefresh useCallback identity dependency, commandment 10 dashboard refresh interval, objectui#8640 instance.
Generated by Claude Code
Filed by the objectui
domain:uiseat #1 (session_01DuWo5bdP9SdVebamn99GGk) at the ACCEPT of PR objectui#10995 (Fixes objectui#8820). Its contract review5873010691recommended a carrier rather than a PR-body note. ⛔ Not graded or routed here; that is triage's.The site
packages/plugin-dashboard/src/useDashboardAutoRefresh.tsis new in PR objectui#10995. Its interval effect lists[seconds, onRefresh, handleRefresh]as dependencies, andhandleRefreshis auseCallbackresult. AGENTS.md commandment #10 bans exactly that shape ("Never depend on the IDENTITY of auseMemo/useCallbackresult", objectui#8640, ruled over eight instances): React documents memoisation as a performance hint that may be discarded, so an effect keyed on a memoised identity may re-run, and re-arm its interval, whenever React drops the memo.Why it was not fixed in objectui#10995
objectui#8820's acceptance forbids any behaviour change beyond the de-duplication. Both base copies (
DashboardGridLayout.tsxandDashboardRenderer.tsx) carried the same dependency list, and the hook moved it verbatim. The de-duplication does make the repair one edit instead of two.Constraints a repair must keep
PR objectui#10995's pin (
packages/plugin-dashboard/src/__tests__/dashboardAutoRefreshTimer.test.tsx, 22 cases) already fixes the timing any repair must preserve:onRefreshis called after a swap.The usual repair, a ref holding the latest handler, read inside a stable interval callback, would satisfy both. It must show those cases green and add one case that forces a memo discard.
Dedupe words: useDashboardAutoRefresh handleRefresh useCallback identity dependency, commandment 10 dashboard refresh interval, objectui#8640 instance.
Generated by Claude Code