Suspense mode resumes with the previous observable's value on React 19
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 48/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- Calme
- Stack technique
- react, typescript
- Domaine
- frontend
Piste de recherche
Exécutez npx vitest run useObservable et commencez par test/useObservable.test.tsx, en particulier emits the new observable's value if the observable is swapped out. Suivez le SuspenseSubject nommé, le cache preloadedObservables et le chemin use-sync-external-store. La tâche est terminée lorsque le test est redevenu un simple it et passe sous React 19, tout en conservant le comportement de React 18.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- TypeScript
- Étoiles
- 3.6k
- Forks
- 403
- Merge moyen
- 5 j 1 h
- PR mergées (30 j)
- 10
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de FirebaseExtended/reactfire
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 38/100
FirebaseExtended/reactfire#801 ·
-
v5
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
FirebaseExtended/reactfire#790 · 2 commentaires ·
-
v5
Difficulté 4/5 3-5 jours Accessibilité débutants 55/100
FirebaseExtended/reactfire#789 ·
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
FirebaseExtended/reactfire#788 ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 55/100
FirebaseExtended/reactfire#784 ·
Toutes les issues de FirebaseExtended/reactfire
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
bcgov/bc-wallet-mobile#4761 · 1 commentaire ·
-
external-issue to-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
-
area-deployment area-integrations triage:bot-seen
Difficulté 2/5 Une demi-journée Accessibilité débutants 86/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
-
refactor
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100