Unawaited state updates in web settings and remote-assignment tests throw after happy-dom teardown under high worker concurrency
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- react, tailwindcss, typescript
- 领域
- testing-qa
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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).
- 主要语言
- TypeScript
- 星标
- 119
- 派生
- 19
- 平均合并
- 1 天 18 小时
- 30 天内合并 PR
- 61
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
DouglasNeuroInformatics/OpenDataCapture 的其他 Issue
-
Area: API Bug Difficulty: Low Priority: Low
难度 2/5 1-3 小时 新手友好度 62/100
DouglasNeuroInformatics/OpenDataCapture#1937 ·
维护者通常 1 天内回复
-
Area: Infrastructure Bug Difficulty: Low Priority: Medium Security
难度 2/5 1-3 小时 新手友好度 72/100
DouglasNeuroInformatics/OpenDataCapture#1916 ·
维护者通常 1 天内回复
-
Area: Infrastructure Chore Difficulty: Low Priority: Medium
难度 2/5 1-3 小时 新手友好度 70/100
DouglasNeuroInformatics/OpenDataCapture#1835 ·
维护者通常 1 天内回复
-
Area: Instruments Bug Difficulty: Low Priority: Low
难度 2/5 1-3 小时 新手友好度 78/100
DouglasNeuroInformatics/OpenDataCapture#1824 · 1 条评论 ·
维护者通常 1 天内回复
-
Completing a series instrument logs a TypeError "Cannot read properties of undefined (reading 'kind')"可能已有人在做 @SAY-5 于 3 天前认领。 未关闭Area: Shared Bug Difficulty: Low Priority: Low
难度 2/5 1-3 小时 新手友好度 70/100
DouglasNeuroInformatics/OpenDataCapture#1813 · 1 条评论 ·
维护者通常 1 天内回复
查看 DouglasNeuroInformatics/OpenDataCapture 的全部 Issue
相似的 Issue
-
infra needs-triage
难度 2/5 1 小时以内 新手友好度 82/100
LucasSantana-Dev/Lucky#3331 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
kOaDT/oss-oopssec-store#381 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
nocobase/nocobase#11669 · 1 条评论 ·
维护者通常 1 天内回复
-
iOS: Clear Context (/clear) and model picker fallback use negative agent check instead of isClaude未关闭
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复