Evaluate signed-zero equality for QueryObserver snapshots
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- react, typescript
Direzione di ricerca
Start with the signed-zero regression case in packages/query-core/src/__tests__/queryObserver.test.tsx, then read the result comparison in packages/query-core/src/queryObserver.ts and shallowEqualObjects in packages/query-core/src/utils.ts. This issue asks maintainers to decide the intended equality semantics, including effects on notifications, NaN, and snapshot caching; it is design work rather than a scoped first contribution. Done means the behavior is documented and, if changed, regression tests cover the optimistic result, current snapshot, and affected equality and notification behavior.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
Evaluate whether QueryObserver snapshots should distinguish -0 from 0 when selected placeholder data changes. This is a follow-up for maintainers to decide the desired equality semantics; it does not assume that a global equality change is required.
Reproduction and current behavior
In the signed-zero regression case in packages/query-core/src/__tests__/queryObserver.test.tsx, create an observer with enabled: false, placeholderData: 1, structuralSharing: false, and a selector returning -0. Update the options to use a selector returning 0, then call getOptimisticResult with the updated options.
The PR author verified that the optimistic result contains 0, while getCurrentResult().data still contains -0. The shallow comparison treats these values as equal and preserves the current snapshot. The useQuery render in this case uses the optimistic result.
Decision and affected areas
Review the observer result comparison and update behavior in packages/query-core/src/queryObserver.ts and shallowEqualObjects in packages/query-core/src/utils.ts. Consider whether signed zeros should count as different, and whether any change should be local to observer results or use Object.is semantics more broadly. Assess effects on notifications, render optimizations, other equality cases such as NaN, and the useSyncExternalStore snapshot caching contract.
Acceptance criteria
- Maintainers decide and document the intended signed-zero behavior for observer snapshots.
- If a change is warranted, implement the chosen behavior without breaking snapshot stability or notification semantics.
- If a change is made, add regression coverage for the chosen behavior, including the optimistic result and current snapshot, and cover any affected equality and notification behavior.
Context
- Pull request: https://github.com/TanStack/query/pull/12564
- Review discussion: https://github.com/TanStack/query/pull/12564#discussion_r4509388878
- Requested by: @brennanbutler01
- Lingua principale
- TypeScript
- Stelle
- 50.6k
- Fork
- 4.2k
- Merge medio
- 8h 37m
- PR unite (30g)
- 450
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di TanStack/query
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
TanStack/query#12466 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
solid-query: STRICT_READ_UNTRACKED on Solid 2 — client()/options() read in component body (useMutation, useBaseQuery)Forse di nuovo libera @LeonxLJX l’ha presa 74 giorni fa e non c’è nessuna pull request aperta. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
TanStack/query#11358 · 2 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
I maintainer di solito rispondono entro 1 giorno
-
Infinite render loop when select maps keepPreviousData to undefined in v5.105.2+Forse già presa @mooxl l’ha presa 6 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
TanStack/query#12574 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
infiniteQuery throws "getNextPageParam is not a function" when 2+ stale pages are cachedForse già presa @abu-tahir-0 l’ha presa 7 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 42/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di TanStack/query
Issue simili
-
Type/Improvement
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
OpenNSW/nsw-srilanka#1259 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
oxc-project/tsrs#1010 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Fission-AI/OpenSpec#2260 ·
I maintainer di solito rispondono entro 1 giorno
-
Add: ESP 1 UKApertacheck:passed streams:add
Difficoltà 1/5 1-3 ore Idoneità per principianti 64/100
I maintainer di solito rispondono entro 1 giorno
-
area:infra area:storage bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
THU-MAIC/OpenMAIC#2311 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno