Repository navigation
Conversation
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
✅ Deploy Preview for dexterplanner canceled.
|
cvburgess
deleted the
dex-241-fix-fe-test-teardown-leak-and-flaky-usenotes-act-failure
branch
October 20, 2026 17:35
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
Animated.timingcalls were never stopped, so a ring unmounted mid-fill kept scheduling rAF frames. In Jest this caused the "environment has been torn down" ReferenceError fromHabitTracker.test.tsxon every run, because the future-day case unmounts within the 300ms animation.useNotes/useListsmutation tests now end onsettleQueries. Before, they ended on a mock's call count, so react-query's late notifications landed in the next test. That's the CI flake inuseNotes › rolls back the optimistic note…. Stress results:useNotesfailed 1 in 24 parallel runs before and 0 in 48 after.--forceExit.jest.setup.jsnow installs a react-querytimeoutManagerprovider thatunref()s its timers, so the un-clearedQueryClientgc timers (5 min) no longer hold workers open. They still fire; they just don't block exit. This removes the "worker process has failed to exit gracefully" warning, and from now on that warning means a real leak.useLists(6 failures in 32 runs), which is fixed here too (0 in 48).Closes DEX-241
Documentation updates
docs/testing.md: replaced the "npm testneeds--forceExit" bullet, now obsolete, with "don't add it back" and where the gc timers are handled.Test plan
npm testrun 25 times in a row: no failures, no torn-down / worker-exit / act() output, and Jest exits on its own--detectOpenHandlesreports nothingnpm run typecheck,npm run lint,npm run format:checkpass