Suspense mode resumes with the previous observable's value on React 19
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- react, typescript
- 领域
- frontend
调研方向
运行 npx vitest run useObservable,并从 test/useObservable.test.tsx 开始,尤其关注 emits the new observable's value if the observable is swapped out。跟踪指定的 SuspenseSubject、preloadedObservables 缓存以及 use-sync-external-store 路径。完成的标准是将测试恢复为普通的 it,并在保留 React 18 行为的同时通过 React 19 下的测试。
由索引模型根据 Issue 内容生成。
描述
useObservable in suspense mode suspends correctly when the observable and observableId are swapped, then resumes rendering the previous observable's value.
Found by the first test run ever executed against React 19 (#789); nothing had run against 19 before, only type-checks.
Reproduction
test/useObservable.test.tsx, emits the new observable's value if the observable is swapped out. The test renders a component under React.Suspense, emits Jeff on the first observable, swaps both the observable and the observableId, rerenders, then emits James on the second.
- React 18.2.0: the fallback shows, then the component resumes with
James. Passes. - React 19.2.8: the fallback shows (that assertion passes), then the component resumes with
Jeff. Fails.
Deterministic: 3 runs each way, same @testing-library/react 16.3.2, only the React runtime swapped via npm install --no-save react@19 react-dom@19. No emulators involved, so npx vitest run useObservable reproduces it.
What is known and not known
- The suspend half works. Only the resume is wrong, so this is not the known throw-vs-
use()question: the 08-07 spike found theuse()swap is a behavioural no-op on 19 and that React 19 emits no warning for the current throw form. Nothing here contradicts that. - The cause is not diagnosed. The plumbing involved (
SuspenseSubject, thepreloadedObservablescache keyed byobservableId, and theuse-sync-external-storeshim delegating to React's ownuseSyncExternalStoreon 19) overlaps what #790 covers, but no connection has been established and it should not be assumed.
Current state
#789's CI PR skips this test on React 19 only, so the new test job can land green. The skip is a ? it.skip : it ternary rather than it.skipIf, because these globals are typed by @types/jest and skipIf fails tsc while working at runtime.
Restore it to a plain it when this is fixed.
- 主要语言
- TypeScript
- 星标
- 3.6k
- 派生
- 403
- 平均合并
- 5 天 1 小时
- 30 天内合并 PR
- 10
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
FirebaseExtended/reactfire 的其他 Issue
-
难度 5/5 一周以上 新手友好度 38/100
FirebaseExtended/reactfire#801 ·
-
v5
难度 4/5 3-5 天 新手友好度 35/100
FirebaseExtended/reactfire#790 · 2 条评论 ·
-
v5
难度 4/5 3-5 天 新手友好度 55/100
FirebaseExtended/reactfire#789 ·
-
难度 5/5 一周以上 新手友好度 35/100
FirebaseExtended/reactfire#788 ·
-
难度 4/5 3-5 天 新手友好度 55/100
FirebaseExtended/reactfire#784 ·
查看 FirebaseExtended/reactfire 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
bcgov/bc-wallet-mobile#4761 · 1 条评论 ·
-
external-issue to-triage
难度 2/5 1-3 小时 新手友好度 88/100
-
area-deployment area-integrations triage:bot-seen
难度 2/5 半天 新手友好度 86/100
-
难度 2/5 1-3 小时 新手友好度 82/100
-
refactor
难度 2/5 1-3 小时 新手友好度 84/100