Unawaited state updates in web settings and remote-assignment tests throw after happy-dom teardown under high worker concurrency
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- react, tailwindcss, typescript
- Domain
- testing-qa
Research direction
Start with the two test files named in the issue: apps/web/src/routes/_app/admin/tests/settings.test.tsx (the autosave onSuccess timer and the unmount effect around settings.tsx:161-166) and apps/web/src/routes/_app/session/tests/remote-assignment.test.tsx at the two redirect-URL tests near lines 238 and 250. Reproduce by running the apps/web unit tests under high worker concurrency. Done means the timer is cleared on unmount or the tests wait for the post-submit state to settle, with no uncaught window errors across repeated runs.
Written by the indexing model from the issue text.
Description
Under high Vitest worker concurrency (reproduced on a 32-core Linux host where pnpm test:coverage spawns 31 workers), two apps/web unit test files intermittently fail the run with an uncaught ReferenceError: window is not defined inside React (resolveUpdatePriority in react-dom-client.development.js:944:7) when a state update fires after happy-dom has torn down window:
apps/web/src/routes/_app/admin/settings.tsx:92(apps/web/src/routes/_app/admin/__tests__/settings.test.tsx):autosave'sonSuccesscallback schedulessavedTimerRef.current = setTimeout(() => setSaveState('idle'), 2000), and the unmountuseEffectat lines 161–166 clearsdurationDebounceRef.currentwithout clearingsavedTimerRef.current. Under worker contention, worker teardown can cross the 2s mark and runsetSaveState('idle')afterwindowis gone.apps/web/src/routes/_app/session/__tests__/remote-assignment.test.tsx:238,250: both redirect-URL tests callsubmitForm()and return as soon asawait waitFor(() => expect(mocks.mutateAsync).toHaveBeenCalled())passes, beforeonSubmitand@douglasneuroinformatics/libui'sFormhandleSubmit(Form.js:87:13) finish their post-submitsetStatemicrotasks (comparecreateAssignmentat line 124, which waits for the renderedAssignment Link).
- Dominant language
- TypeScript
- Stars
- 119
- Forks
- 19
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 61
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DouglasNeuroInformatics/OpenDataCapture
-
Area: API Bug Difficulty: Low Priority: Low
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
DouglasNeuroInformatics/OpenDataCapture#1937 ·
Maintainers usually reply within 1 day
-
Area: Infrastructure Bug Difficulty: Low Priority: Medium Security
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
DouglasNeuroInformatics/OpenDataCapture#1916 ·
Maintainers usually reply within 1 day
-
Area: Infrastructure Chore Difficulty: Low Priority: Medium
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
DouglasNeuroInformatics/OpenDataCapture#1835 ·
Maintainers usually reply within 1 day
-
Area: Instruments Bug Difficulty: Low Priority: Low
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
DouglasNeuroInformatics/OpenDataCapture#1824 · 1 comment ·
Maintainers usually reply within 1 day
-
Completing a series instrument logs a TypeError "Cannot read properties of undefined (reading 'kind')"Possibly taken @SAY-5 claimed this 3 days ago. OpenArea: Shared Bug Difficulty: Low Priority: Low
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
DouglasNeuroInformatics/OpenDataCapture#1813 · 1 comment ·
Maintainers usually reply within 1 day
All issues in DouglasNeuroInformatics/OpenDataCapture
Similar issues
-
infra needs-triage
Difficulty 2/5 Under an hour Newbie friendliness 82/100
LucasSantana-Dev/Lucky#3331 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
kOaDT/oss-oopssec-store#381 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
nocobase/nocobase#11669 · 1 comment ·
Maintainers usually reply within 1 day
-
iOS: Clear Context (/clear) and model picker fallback use negative agent check instead of isClaudeOpen
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day