[2.0 / next] latest() over an optimistic guess answers the re-asked truth once a re-ask lands while the guess is pending
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- javascript, typescript
- Ambito
- frontend
Direzione di ricerca
The issue gives a reproducer using createOptimisticStore, createOptimistic, latest(), untrack(), and refresh(), but names no source files or tests. Start by searching the repository for latest() and optimistic store tests, then reproduce the table’s sequence: keep a guess pending while a refreshed source answer lands. Done when latest() continues to read the pending guess, matching the visible store and untrack() until the action settles.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
On 2.0.0-rc.21 (next @ 2105ffb8).
A guess is pending on an optimistic store (or a createOptimistic). Its source is re-asked from outside the action and the new answer lands while the guess is still pending. The store keeps showing the guess (as #4330 intended), but latest() over it now answers the re-asked truth. Before the re-ask landed, latest() answered the guess. untrack() answers the guess throughout.
const [issues, setIssues] = createOptimisticStore(async d => { const r = await ask("fetch"); d.length = r.length; r.forEach((x, i) => { d[i] = { ...x }; }); }, [], { key: "id" });
const close = action(function* (id) {
setIssues(d => { const v = d.filter(t => t.id != id); d.length = v.length; v.forEach((x, i) => { d[i] = x; }); });
yield ask("close");
refresh(issues);
});
Steps: land fetch = [{id:1},{id:2},{id:3}]; close(1) (its close stays in flight); refresh(issues) from outside the action; land fetch = the same three rows.
| read | guess pending, before the re-ask lands | guess pending, re-ask landed | expected |
|---|---|---|---|
issues.length |
2 | 2 | 2 |
untrack(() => issues.length) |
2 | 2 | 2 |
latest(() => issues.length) |
2 | 3 | 2 |
latest(() => [...issues].map(x => ({...x}))).length |
2 | 3 | 2 |
The signal form does the same. createOptimistic(() => truth()) over createSignal(async () => ...), a guess title: "New" pending, then an outside refresh(truth) lands with "Old": detail().title and untrack say New, latest(() => detail().title) says Old.
On the screen: a tab count computed with latest(() => issues.length) shows 3 while the list under it shows 2 rows, until the close lands.
How we found it: ReactiveScript's latest x lowers to latest(), and its checker suggests latest x for a count read outside a loading on region. A fuzzed issue desk showed the count disagreeing with its own rows whenever a list refresh landed while a row close was in flight.
- Lingua principale
- TypeScript
- Stelle
- 36.2k
- Fork
- 1.1k
- Merge medio
- 9h 58m
- PR unite (30g)
- 474
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 solidjs/solid
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
I maintainer di solito rispondono entro 1 giorno
-
1.x
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
I maintainer di solito rispondono entro 1 giorno
-
What gets passed to the `when` prop of a `Show` still gets executed twice on SSRForse già presa @brenelz l’ha presa 6 giorni fa. Aperta1.x
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
solidjs/solid#4447 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di solidjs/solid
Issue simili
-
Chip source filter and denial markers miss Storage rows when a Storage activity source is pickedApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
omdsh-dev/DSH-better-sidebar#1141 ·
I maintainer di solito rispondono entro 2 giorni
-
desktop linux photos
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Cleanup SetupForse già presa @AlexanderKaran l’ha presa oggi. Apertadocumentation enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
e18e/framework-tracker#769 ·
I maintainer di solito rispondono entro 1 giorno
-
fix(docker): correct stale --db-path comments in fetch/git Dockerfiles and clarify git READMEApertabug v2
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
modelcontextprotocol/servers#5483 ·
I maintainer di solito rispondono entro 1 giorno