Skip to content

Other Console browser tests rewrite Command records in place while a page is open #1350

Closed

Description

@JacobStephens2

Finding

Console browser test files other than the Inbox tests still rewrite Command records in place with fs.writeFile while a page is open. That is the hazard behind #1223, so they can fail intermittently the same way and block a release.

Evidence

  • Cause, diagnosed in the pull request for Intermittent Inbox selection browser failures block releases #1223 (branch issue-1223): writeFile truncates and then writes. A push that reads the record in between gets an unparsable file. src/logs/reading/cache.rs parses it with serde_json::from_slice(...).ok(), the row is left out of that push, and the Inbox's morph() clears its selection and focus. The recorder never exposes a partial record: it replaces records with a temp file and rename (src/logs/effects.rs replace_record; Stop requests use src/logs/stop.rs persist_noclobber).
  • A held-open torn write reproduced all three Inbox CI failure signatures. The Inbox tests now use replaceRecord from console/tests/records.cjs (temp file + rename).
  • Remaining in-place record writes while a page is open, as reported by the review of that pull request: console/tests/stop.test.cjs:56,105, notifications.test.cjs:128,194, logs.test.cjs:38-246, time.test.cjs:130-339, waterfall.test.cjs:135, themes-regressions.test.cjs:50. Example, time.test.cjs:130: await writeFile(path, JSON.stringify(fixture)); await page.getByText(fixture.issue.title, { exact: true }).waitFor();

Raised by

The Standards and Spec reviews of the pull request for #1223 (branch issue-1223).

Why this was not decided there

#1223's Agent Brief scopes the work to "The Inbox browser tests". No failure in these other files has been observed or reproduced yet, so whether to convert them, and in which pull request, is for the Day shift to decide.

Activity

  1. added
    needs-triage
    on Oct 25, 2026
  2. added
    in-progress
    and removed
    needs-triage
    on Nov 10, 2026
  3. JacobStephens2 commented on Nov 10, 2026

    @JacobStephens2
    OwnerAuthor

    This was generated by AI during triage.

    Agent Brief

    Convert the remaining non-Inbox Console browser fixtures that publish or replace Command records during live observation to the existing replaceRecord helper in console/tests/records.cjs. This fits one standalone Ticket.

    Confirmed diagnosis

    Investigated selected Base commit 02c96545737cbd35efb69dd1ef93594f218ba9f2, matching local main. src/logs/reading/cache.rs:128 turns unparsable record JSON into None; src/logs/reading.rs:474 skips that record. An in-place writeFile can therefore temporarily remove a Command from a refreshed page. Production recording already publishes complete records through a temporary file and rename (src/logs/effects.rs:80); the browser fixtures should follow that publication behavior.

    The existing test several tabs notify once per rise, including a rise after a fall; off stays off passes normally. A scratch preload intercepted only its title update at console/tests/notifications.test.cjs:130, truncated the record, and held completion until all three pages displayed Needs you falling from 2 to 1 and the shared notification snapshot recorded that fall. After restoring the complete updated JSON, the existing assertion at line 133 failed with actual notification count 2, expected 1. The same targeted update routed through replaceRecord passed, with the previous complete record still readable before rename. This confirms a failure outside the Inbox test file and supports proceeding with the conversion.

    Scope

    Use the shared helper for Command-record creation, updates and restores that can overlap Console observation in stop.test.cjs, notifications.test.cjs, logs.test.cjs, time.test.cjs, waterfall.test.cjs, and themes-regressions.test.cjs. Include the additional confirmed live update and restore in console/tests/spans.test.cjs:169,176, after the Waterfall page opens at line 150. Review setup writes separately: several locations cited in the original report precede browser navigation. Converting those for consistency is acceptable. Preserve intentional writes and appends to logs, Session traces, configuration and other non-record fixtures, along with existing assertions and cleanup. Keep this change within the browser-test fixtures and shared helper.

    Acceptance and validation

    All identified live Command-record publications and restores use temporary-file replacement through replaceRecord. Preserve the notification test's assertion that a title-only update produces no extra notification. Do not mask the race with longer timeouts or retries. Run the affected browser files during implementation, then scripts/affected-tests main, which selects the Console build and browser suite for Console changes.

  4. added
    bug
    ready-for-agent
    in-progress
    and removed
    in-progress
    ready-for-agent
    on Nov 10, 2026
  5. removed
    in-progress
    on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions