[2.0 next, regressed after rc.13] Awaited refresh returns the caller optimistic override
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
- 64/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- javascript, typescript
- Ambito
- frontend
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 36.1k
- Fork
- 1.1k
- Merge medio
- 11h 42m
- PR unite (30g)
- 326
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
-
[2.0 next, regressed after rc.13] Async-generator action times out on its authoritative live echoAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 Mezza giornata Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/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
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di solidjs/solid
Issue simili
-
bug(sight): the dashboard's text truncations split surrogate pairs and show broken charactersApertacomponent:sight
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
agentic-os-org/ANOLISA#6738 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
bug Durable Agents Observability (AI Telemetry) status: needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
mastra-ai/mastra#26470 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
paperclipai/paperclip#15630 ·
I maintainer di solito rispondono entro 1 giorno
-
[good first issue, hacktoberfest] ⛩️ Add new Theme: Sakura Latte (good-first-issue)Forse già presa @PGrayCS l’ha presa oggi. Apertacommunity first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficoltà 1/5 1-3 ore Idoneità per principianti 78/100
lingdojo/kana-dojo#31937 · 1 commento · 5 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
feature/cohorts feature/feature-flags team/feature-flags
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno