[2.0 next, regressed after rc.13] Awaited refresh returns the caller optimistic override
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
- 64/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, typescript
- Área
- frontend
Línea de trabajo
Start with the reproduction in App.tsx and run repro.test.ts or snippet.test.ts using the linked setup. Then trace how refresh, action, and createOptimistic interact in Solid's source. Done means the awaited refresh returns the source value 2 rather than the optimistic override 99.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
Refreshing an optimistic accessor inside its own action returns the optimistic guess instead of the source answer.
Your Example Website or App
Steps to Reproduce the Bug or Issue
- Use the source below with the selected Solid build (complete setup is linked above).
import { action, createOptimistic, createSignal, refresh, resolve } from "solid-js";
export default function App() {
const [value, setValue] = createOptimistic(() => Promise.resolve(2));
const [result, setResult] = createSignal("idle");
const save = action(function* () {
setValue(99); // The caller's optimistic guess, not server truth.
return yield refresh(value);
});
async function run() {
await resolve(value);
setResult(String(await save())); // Observed 99; the source returns 2.
}
return (
<>
<button id="trigger" onClick={run}>
Refresh inside action
</button>
<output id="answer">{result()}</output>
</>
);
}
- Paste into a Solid 2 playground. Click Refresh inside action and wait.
Expected behavior
Expected: The output becomes 2, the value produced by the source.
Actual: The output becomes 99, the action’s optimistic guess.
Platform
- Solid:
solid-js/@solidjs/webnext at3086f1b77cd7b0431d3a7f768c2984c335758633; comparison2.0.0-rc.13. Signals, compiler and diagnostics match the selected Solid build. - OS: macOS 26.6.2 (25G83); browser cases: system Google Chrome 155.0.8059.40. Server-only/type checks run in Bun 1.4.2.
- Builds/comparison: development and production fail. rc.13 passes in both builds.
Additional context
Refresh requests authoritative data; the caller's optimistic overlay must not become that authoritative result.
Full automated reproduction
One-command setup, run and expected output.
Copy the standalone files into a fresh Bun project. The displayed snippet is executed by snippet.test.ts. The original automated case is also retained.
bun init -y
bun add [email protected] @solidjs/[email protected] @solidjs/[email protected] @solidjs/[email protected] @solidjs/[email protected]
bun add -d playwright
bun run link-head.ts /absolute/path/to/built/solid
BUILD_MODE=development bun test ./snippet.test.ts
The five linked packages must come from the same built HEAD checkout. Omitting the link step selects the rc.13 comparison. Chrome runs use the system installation.
- Lenguaje dominante
- TypeScript
- Estrellas
- 36.1k
- Forks
- 1.1k
- Merge medio
- 11 h 25 min
- PR fusionados (30 d)
- 345
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 4/5 3-5 días Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 12/100
Los mantenedores suelen responder en 1 día
-
Select loses its bound value when options load asynchronouslyPosiblemente ocupada @MokiMeow la tomó hoy. Abierto
Dificultad 3/5 Medio día Aptitud para principiantes 45/100
solidjs/solid#3928 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 18/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 24/100
solidjs/solid#3923 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de solidjs/solid
Issues similares
-
Mondriaan
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
knaw-huc/textannoviz#709 ·
Los mantenedores suelen responder en 1 día
-
Add: YRF Music NepalAbiertostreams:add
Dificultad 1/5 Menos de una hora Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
walletbeat/walletbeat#1558 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
hawk-digital-environments/HAWKI#438 ·
Los mantenedores suelen responder en 1 día
-
good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
OktoLabsAI/okto-pulse#114 ·
Los mantenedores suelen responder en 1 día