fix(panel): re-read the summary while a run is shown as running - #382
Draft
lamemustafa wants to merge 2 commits into
Draft
lamemustafa wants to merge 2 commits into
lamemustafa wants to merge 2 commits into
Conversation
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The running-to-interrupted transition is a pure function of the clock, so no storage event fires and an open panel kept rendering a dead run with no exit. A timer gated on a running summary re-reads it every ten seconds and stops once the run settles. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Closes #368. A run becomes interrupted by the clock alone: a dead worker writes nothing and never removes its lease, so no storage event fires. The panel refreshed its summary only on mount and on
storage.onChanged, so a panel left open across a worker death kept rendering the run as in progress, with no retry control, until it was reopened. The owner hit exactly this live on 2026-09-16 ("reopened, retry button is there now").An interval re-reads the summary every ten seconds only while the summary shows a run as
running, and stops once it settles.Root Cause / Decision Record
storage.onChangedwere the only refresh paths.status === "running": an idle surface never polls, and the effect's cleanup clears the interval when the status changes or the surface unmounts.PACK_GET_FILED_RETURNS_FLOW_SUMMARYread: no network, no storage write.refreshFlowSummary()without adopting the saved run's scope, like the return-to-panel refresh.Scope
src/entrypoints/popup/use-pack-popup-controller.ts(one exported constant, one gated effect).tests/popup/use-pack-popup-controller.test.tsx: re-reads and renders the interruption with no storage event (all-supported and single-return), stops after settling, never polls when idle.hasUnresolvedFiledReturnsRecoveryStateinsrc/background/local-data.ts). The acknowledge path clears it first, so it is friction rather than a lockout; separate change.Held for a live run
AGENTS.mdrequires a live authenticated run for runtime changes, and the issue asked that this one be watched doing its job rather than inferred. Draft until then. The check: start a full-year run with the panel open, stop the service worker, leave the panel open, and confirm the retry control appears within about forty seconds without reopening.Pack Workflow Preflight
pnpm workflow:preflightwas run before editing/push, or the skip reason is documented.Sanchika Adoption Gate
Not applicable: no Sanchika adoption.
@sanchika/*packages or copied Sanchika guidance, Iread
sanchika/docs/adoption-pack.mdin the coordinated parent worktree.and records the Sanchika commit or copied guidance used.
../sanchika,sanchika/packages/*/src, or parentsource paths.
Privacy And Data-Flow Impact
Sensitive Surface Review
Chrome Web Store Impact
docs/PUBLICATION_READINESS.mdis checked.Verification
pnpm install --frozen-lockfilepnpm audit --audit-level highpnpm exec wxt preparepnpm exec prettier --check .pnpm exec eslint . --max-warnings 0pnpm exec tsc --noEmitpnpm exec vitest runpnpm exec wxt buildnode scripts/verify-extension-package.mjs .output/chrome-mv3pnpm exec wxt zipnode scripts/verify-extension-zip.mjsnode scripts/write-release-provenance.mjsnode scripts/verify-github-release-assets.mjs --tag <tag> --zip <zip> --checksum <sha256> --provenance <json>when release assets existnode scripts/publish-chrome-web-store.mjs --zip .output/<zip> --provenance .output/pack-release-provenance.v1.json --publisher-id <id> --dry-run truegit diff --checkpnpm review:gate -- --strict-head-review --wait-head-review-ms 180000before merge/readiness claim; a missing Codex review blocks readiness:Artifact Evidence
PR Review Follow-Up
runningonce the lease is stale; no forever-polling pathtoAllSupportedFullFiscalYearSummaryandactiveRunSummary(30s window)applyFlowResponse's failure branch does not bumpsummaryRefreshEpoch, so a timer read racing a failed action applies a slightly older read. A failed action writes no summary, so nothing fresher is overwritten;storage.onChangedalready has the same exposureScreenshots
Use synthetic data only.
Verification detail
Exit codes captured directly: prettier
0· eslint0· tsc0· build0· package verification0·git diff --check0· workflow preflight passed.Popup and panel suites:
Test Files 27 passed (27),Tests 411 passed (411). The full suite is left to CI because of tonight's machine load.Driven to failure, each on its own: removing the gate fails the idle and settled tests; dropping the all-supported condition fails its test; dropping the single-return condition fails its test; not clearing the interval fails the settled test.
🤖 Generated with Claude Code