Repository navigation
Conversation
The coalescing test waited 20 ms on a real timer between mounts while the code under test flushes after 32 ms of quiet, so a slow runner could flush early and record an extra change. The whole describe block now drives the debounce with fake timers and explicit advances instead of real sleeps and waitFor polling. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael
deleted the
bb/make-threadactionsmenu-coalescing-test-determini-thr_k8tatkzgy8
branch
November 7, 2026 03:05
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.
Human comments
What was wrong
ThreadActionsMenu.test.tsx› "coalesces rows that mount a moment apart into one change" failed on a Windows CI run of #7208 and passed on rerun. The thread-id subscription debounce inthread-action-registry.tsxflushes after 32 ms with no new rows (100 ms max wait). The test mounted two rows, slept 20 ms on a real timer, then added a third. On a slow runner the sleep can last longer than 32 ms, so the first two ids flush on their own and the test sees an extra change.What changed
Only the test changed. The
thread action data inputdescribe block now usesvi.useFakeTimers(). Vitest 4 fakessetTimeoutandperformance.now()by default, so this controls both the quiet window and the max wait. Real sleeps andwaitForpolling were replaced withact(() => vi.advanceTimersByTimeAsync(ms)). The other three tests in the block used the same real-timersettle(150 ms), so they were converted too. Their assertions are unchanged; eachwaitForis now asettle()followed by the sameexpect. No other test in the file relies on real-time delays.How you verified
pnpm exec turbo run test --filter=@bb/app -- src/components/thread/ThreadActionsMenu.test.tsx: 64 passed, 1 skipped.THREAD_IDS_QUIET_MSlowered to 10, the coalescing test fails, so it still checks the debounce.turbo run typecheck --filter=@bb/app, oxlint and prettier: all clean.🤖 Generated with Claude Code