Skip to content

Fix Fleet Inbox notification and Undo races - #2310

Merged
JacobStephens2 merged 4 commits into
mainfrom
issue-2307
Nov 19, 2026
Merged

JacobStephens2 merged 4 commits into
mainfrom
issue-2307

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fix two races in the Fleet Inbox check: in-place fixture writes can produce a false notification, and an Undo notice accepts a click while Dismiss is still refreshing, then drops it.

fixture update → complete temporary JSON → rename → Fleet poll
Dismiss saved → create Undo notice → apply pending state → refresh → enable Undo

Keep all existing assertions. Add a deterministic pending-Undo check, verify Undo after reload, and establish the two-row notification baseline before changing fixtures.

Closes #2307.

Evidence

Execution evidence

  • Notification before: npm test from console/ at 3c6e094 failed with expected /^3 need you/; actual '2 need you · …'. Original CI failure. A local reproduction that widens the live fixture's truncate/write window by 700 ms produced the same failure; atomic replacement passed that reproduction.
  • Undo before: node --test --test-name-pattern='Fleet Inbox polls' console/tests/fleet.test.cjs, with the held-refresh regression added before the UI fix, failed: Undo waits for the Dismiss refresh before accepting another action; false !== true. CI also reproduced the resulting Undo timeout.
  • Undo after: node --test --test-name-pattern='Fleet Inbox polls' console/tests/fleet.test.cjs: 1 passed against the rebuilt binary. THIRDSHIFT_CONSOLE_ASSETS="$PWD/src/console/assets" node --test console/tests/fleet.test.cjs: 2 passed.
  • Local affected checks: CARGO_BUILD_JOBS=3 RUST_TEST_THREADS=3 scripts/affected-tests refs/remotes/origin/main: build passed (35.00 s); all 268 Console browser tests passed (322.81 s), zero skipped. The remote ref is the supplied fixed point; local main predates this worktree’s base.
  • Exact-head CI: console-test, all four Rust partitions, Rust coverage gate, and stable test check passed on 4f0c0b7ee9d0d6c26135cfb02fddc08b0391f32c. Once those Rust checks passed, the duplicate local cargo test run was interrupted, following docs/testing.md’s CI reuse rule.
  • The isolated Dismiss/Undo walkthrough reproduces the dropped click before the fix and restores the row afterward. The fixed walkthrough passes with CSP enabled and zero unexpected browser errors.

Seams under test: real caller/remote Consoles, Fleet polling, persisted Dismiss/Undo, live Inbox rows and browser notifications. The Notification API substitutes for OS delivery; the delayed Inbox response makes the pending-action race deterministic.

Visual evidence

Faux Command records at desktop 1440×900. Screenshots show the pending Dismiss; recordings show the Undo attempt and outcome. The existing Fleet browser test also exercises the phone viewport.

Before — Dismiss pending, desktop 1440×900

Before Dismiss pending at desktop 1440×900

After — Dismiss pending, desktop 1440×900

After Dismiss pending at desktop 1440×900

Before — Dismiss/Undo walkthrough, desktop 1440×900

before-desktop.DsHBD7.mp4

After — Dismiss/Undo walkthrough, desktop 1440×900

after-desktop.exe2HQ.mp4

Review coverage

Standards: 0 actionable findings. Spec: 0 actionable findings. Both final reviewers read both changed files: console/tests/fleet.test.cjs and src/console/assets/console.js. Unread changed files: none. Generated-output exclusions: none.

Security: 0 introduced findings. Guidance-mode source review of 3c6e094fd0c676b2ca65dd41dc9d0a156c2b5f00...4f0c0b7ee9d0d6c26135cfb02fddc08b0391f32c covered both changed files and supporting Dismiss/Undo state, row rendering, CSRF and scope middleware, Fleet action forwarding, and the atomic fixture helper. The added showDismissal() call updates button state and status text; the server still enforces act, CSRF, owning-account checks, and configured Fleet destinations. No proof-of-concept candidate or source fix was needed. This was a source review; the existing runtime evidence above was not rerun.

Unaddressed findings

Standards

None.

Spec

None.

Security

None.

Security review outcome

No unaddressed introduced findings.

Merge Danger

Door: two-way

Blast Radius: Console

Undo now waits until the current Dismiss refresh completes. Fixture publication changes are confined to the Fleet browser test.

Built with codex codex-cli 0.169.0 · gpt-6.1-sol · xhigh

@JacobStephens2 JacobStephens2 added the in-progress A Claim: thirdshift has taken this issue label Nov 19, 2026
@JacobStephens2 JacobStephens2 changed the title Fix Fleet Inbox browser-test fixture publication race Fix Fleet Inbox notification and Undo races Nov 19, 2026
@JacobStephens2

Copy link
Copy Markdown
Owner Author

Review run. The branch moved; no fixes were pushed. Proposed fixes remain in the local worktree. Spec axis used the linked closing issues.

Standards

0 actionable findings. The change reuses the existing atomic publication helper and follows repository standards.

Spec

0 actionable findings. Linked closing issue #2307 is the Spec. Existing assertions remain intact, and the added assertion checks that metadata updates produce no notification.

No fixes were needed. No tracked files changed; no commit was made.

Unaddressed findings

  • Standards: None.
  • Spec: None.

Review coverage

Both reviewers read the complete changed file, console/tests/fleet.test.cjs. Unread changed files: none. Generated-output exclusions: none.

Final files-read lists

Standards

  • AGENTS.md
  • CODING_STANDARDS.md
  • .agents/skills/codebase-design/SKILL.md
  • docs/agents/domain.md
  • GLOSSARY.md
  • docs/code-navigation.md
  • docs/testing.md
  • docs/adr/0016-the-console-is-a-long-running-reader.md
  • docs/adr/0023-the-inbox-reads-github-to-learn-the-day-shift-acted.md
  • docs/adr/0026-each-console-serves-an-api-that-can-do-what-the-cli-can.md
  • console/README.md
  • console/package.json
  • console/tests/fleet.test.cjs
  • console/tests/records.cjs
  • console/tests/notifications.test.cjs
  • console/tests/playwright.cjs
  • src/console/assets/notifications.js
  • src/logs/github.rs
  • src/logs/recording.rs

Spec

  • AGENTS.md
  • .thirdshift-review-input.md
  • CODING_STANDARDS.md
  • .agents/skills/codebase-design/SKILL.md
  • docs/agents/domain.md
  • docs/code-navigation.md
  • GLOSSARY.md
  • docs/testing.md
  • docs/adr/0016-the-console-is-a-long-running-reader.md
  • docs/adr/0023-the-inbox-reads-github-to-learn-the-day-shift-acted.md
  • console/README.md
  • console/tests/fleet.test.cjs
  • console/tests/records.cjs
  • src/logs/effects.rs
  • src/logs/recording.rs
  • src/logs/github.rs
  • src/logs/reading.rs
  • src/console/changes.rs
  • src/console/assets/changes.js
  • src/console/assets/notifications.js

Validation

PR #2310 was checked once immediately before validation and was open. All commands ran in this worktree.

Exact command Result
npm ci --prefix console Exit 0; dependencies installed
scripts/affected-tests 3c6e094fd0c676b2ca65dd41dc9d0a156c2b5f00 Exit 0; selected build and Console tests
cargo build --locked Exit 0; passed in 36.20 s
npm test --prefix console Exit 0; ran node --test tests/*.test.cjs in console/; 268 passed, including both Fleet tests; 0 failed or skipped
git diff --check 3c6e094fd0c676b2ca65dd41dc9d0a156c2b5f00...HEAD Exit 0

No required command failed or could not run. Logs are under .review-logs/.

Saved: Standards report, Spec report, summary.json.

Standards: 0 findings, worst issue: none. Spec: 0 findings, worst issue: none.

Security

No unaddressed introduced findings.

Delivery failed

pull request changed during Review run: head moved; expected 440935d, actual 4f0c0b7

@JacobStephens2 JacobStephens2 removed the in-progress A Claim: thirdshift has taken this issue label Nov 19, 2026
@JacobStephens2 JacobStephens2 added the in-progress A Claim: thirdshift has taken this issue label Nov 19, 2026
Keep the held-refresh Undo regression and reload check, plus main's owning-machine synchronization and no-notification baseline assertion.
@JacobStephens2
JacobStephens2 merged commit 9145823 into main Nov 19, 2026
25 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-2307 branch November 19, 2026 15:16
@JacobStephens2 JacobStephens2 removed the in-progress A Claim: thirdshift has taken this issue label Nov 19, 2026
@JacobStephens2 JacobStephens2 mentioned this pull request Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI red on main: console-test

1 participant