[2.0 / next] latest() over an optimistic guess answers the re-asked truth once a re-ask lands while the guess is pending
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, typescript
- Área
- frontend
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 36.2k
- Forks
- 1.1k
- Merge medio
- 9 h 58 min
- PR fusionados (30 d)
- 474
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de solidjs/solid
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
Los mantenedores suelen responder en 1 día
-
1.x
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Los mantenedores suelen responder en 1 día
-
What gets passed to the `when` prop of a `Show` still gets executed twice on SSRPosiblemente ocupada @brenelz la tomó hace 6 días. Abierto1.x
Dificultad 3/5 1-2 días Aptitud para principiantes 52/100
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
solidjs/solid#4447 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de solidjs/solid
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
transitmatters/shutdown-tracker#155 ·
Los mantenedores suelen responder en 2 días
-
Popping out a single panel leaves its always render overlay in the main window, blocking clicksAbiertobug triaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
"Claude Code request is missing its initial user message" when the prompt starts with an image pathAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
earendil-works/pi-claude-code#31 ·
Los mantenedores suelen responder en 8 días
-
bug pending triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
privatenumber/cleye#48 ·