GeezerVison is showing github.com — test(web): await the file save without draining background timers by romil-bijarnia · Pull Request #29807 · pingdotgg/t3code
Conversation
Problem
The file-save browser test can hang in vi.runAllTimersAsync() because it drains timers for the entire page, including background environment discovery. Background work can keep scheduling timers after the controlled file write has already completed.
The same “writes a pending draft once when the file switches surfaces under StrictMode” case reaches the 15-second project timeout on main at 57cd0590 and on #29727.
Change
Resolve the controlled save inside React act and await its updates instead of draining every background timer. Keep the fake debounce clock and the existing assertions that exactly one draft is written and the pending state is cleared.
Scope and approval
This is a small, focused test-harness bug fix under CONTRIBUTING.md's obvious-bug exception. It changes one existing test, with no product code, assertion removal, timeout increase or retry. Searches for the test, pending drafts and timer draining found no open PR for this repair. #28805 shares a session predicate but does not change this test's timer handling.
This repair is separate from the MCP parsing PR because it corrects an independent failure already present on main.
Verification
macOS, Node 26.12.1, Effect 4.1.2, based on 57cd0590.
- A temporary repeating background timer makes the original test reach its existing 15-second timeout. With the repair, the same test passes with that timer still present. The temporary timer was removed before committing.
- The uninstrumented focused browser test passes with both original save assertions unchanged.
vp run check:changed origin/main --concurrency 2 passes formatting, lint, both Knip checks, affected typechecks and the selected browser test.
- The full web suite with four workers reports 5,412 passed and one failure in the unchanged GuestPage scrolling case; the repaired file-save case passes. A default-concurrency run also encounters the unchanged PDF reload case. Those full-suite results are not claimed as green.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
chatgpt-codex-connector[bot] reacted with thumbs up emoji
Codex Review Summary
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
✅ Completed 2026-11-03T01:15:43.720431Z |
535574a |
PR opened |
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review" or "@codex security review".
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Approvability
Verdict: Approved at 535574a
Macroscope's review found this PR approvable — The change is confined to an ignored browser test and is described as awaiting file-save updates without draining background timers. No product behavior change or material operational exposure is identified.
Notes:
- No code objects were reviewed. Approvability was decided on eligibility alone.
You can add or adjust custom eligibility rules. Learn more.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Walkthrough
-
The browser test now clears the unsaved-file result before awaiting the pending write resolver inside React’s act. It removes the direct resolver call and the subsequent fake-timer flush.
Changes: File save session test
| Layer / File(s) |
Summary |
Update pending-write test apps/web/src/components/files/fileSaveSessions.browser.test.tsx |
The test imports React’s act, clears the unsaved-file result, and awaits the write resolver inside act. It no longer calls the resolver directly or flushes all fake timers. |
Estimated code review effort: 1 (Trivial) | ~3 minutes
Change: Bug fix
Suggested reviewers: juliusmarminge
Merge Risk: Minimal · up to 53557
-
The test update is mergeable with no concrete blocking risk identified.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title names the test-only change: it makes the file-save test await the save inside React act without draining background timers. The changeset is a single test file that replaces vi.runAllTimersA… |
| Description check |
 |
The description follows the template sections (Problem, Change, Scope and approval, Verification). Problem explains the hang in vi.runAllTimersAsync() and gives a CI reference. Change states the act-b… |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
Full details: Title check
-
Explanation
The title names the test-only change: it makes the file-save test await the save inside React act without draining background timers. The changeset is a single test file that replaces vi.runAllTimersAsync() with act-wrapped resolution, so the title matches the main change. It uses the conventional commit form with a plain-language description.
Full details: Description check
-
Explanation
The description follows the template sections (Problem, Change, Scope and approval, Verification). Problem explains the hang in vi.runAllTimersAsync() and gives a CI reference. Change states the act-based fix and the kept assertions. Scope and approval cites the obvious-bug exception and checks for existing PRs. Verification lists the focused runs, the temporary timer reproduction, and the full-suite results, including the failures it does not claim as green. The template asks for a conventional title and an agent/model note at the end when an agent was used. The description does not include an agent or model line, and it does not say whether that applies. These gaps are minor, so the check passes.
Finishing Touches
-
Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning Some tools did not complete. Review the errors below.
ast-grep (0.51.1)
-
ast-grep could not parse rule config: /ast-grep-rules/ast-grep-essentials/rules/go/security/zip-slip-filepath-join-archive-entry-go.yml
CodeRabbit Verify
- Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between f6503f0 and 535574a.
Files selected for processing: 1
-
apps/web/src/components/files/fileSaveSessions.browser.test.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
The GitHub CI run now passes, including the full Test Web job and the required aggregate Check: https://github.com/pingdotgg/t3code/actions/runs/41558324841. This isolates the file-save timeout also observed on main at 57cd059, without changing product code, save assertions or timeout settings. Could a maintainer review this baseline CI repair? It is currently needed to unblock #29727 while keeping the two underlying problems in separate PRs.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Superseded by #29813, merged as 2d2299a. The merged fix isolates the discovery runtime and preserves the test's full timer/debounce coverage. Closing this alternative so there is only one fix for the underlying timeout.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:XS
0-9 changed lines (additions + deletions).
vouch:unvouched
Author is not yet trusted in the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|