Suspense mode resumes with the previous observable's value on React 19
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 48/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Ruhig
- Tech-Stack
- react, typescript
- Bereich
- frontend
Rechercherichtung
Führe npx vitest run useObservable aus und beginne mit test/useObservable.test.tsx, insbesondere mit emits the new observable's value if the observable is swapped out. Verfolge die benannte SuspenseSubject, den preloadedObservables-Cache und den use-sync-external-store-Pfad. Als abgeschlossen gilt die Aufgabe, wenn der Test wieder ein einfaches it verwendet und unter React 19 besteht, während das Verhalten unter React 18 erhalten bleibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 3.6k
- Forks
- 403
- Ø Merge
- 5 T. 1 Std.
- Gemergte PRs (30 T.)
- 10
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus FirebaseExtended/reactfire
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 38/100
FirebaseExtended/reactfire#801 ·
-
v5
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
FirebaseExtended/reactfire#790 · 2 Kommentare ·
-
v5
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 55/100
FirebaseExtended/reactfire#789 ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
FirebaseExtended/reactfire#788 ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 55/100
FirebaseExtended/reactfire#784 ·
Alle Issues in FirebaseExtended/reactfire
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
bcgov/bc-wallet-mobile#4761 · 1 Kommentar ·
-
external-issue to-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
-
area-deployment area-integrations triage:bot-seen
Schwierigkeit 2/5 Ein halber Tag Anfängerfreundlichkeit 86/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
-
refactor
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100