[2.0 rc.13 + next] 304 format header overwrites cached GET representation
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- Mezza giornata
- Idoneità per principianti
- 75/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- web-dev
Direzione di ricerca
Investigate how respond from @solidjs/web handles 304 responses. The bug is that a 304 response's format header overwrites the cached GET representation's body format, causing the decoder to consume the wrong format. Look for where 304 responses are constructed and how headers are merged with cached bodies, then ensure the cached representation's format is preserved.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
Browser-managed conditional GET should replay cached {value:17}. Both client fetches see 200, but the second decoded result is undefined.
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 { getRequestEvent, respond } from "@solidjs/web";
export const calls: (string | null)[] = [];
export function read() {
const headers = {
etag: '"constant"',
"cache-control": "private, max-age=0, must-revalidate",
};
const conditional = getRequestEvent()!.request.headers.get("if-none-match");
calls.push(conditional);
// Call this GET twice in Chrome. Chrome adds If-None-Match itself.
// The second decoded value is undefined, despite cached { value: 17 }.
return conditional === '"constant"'
? new Response(null, { status: 304, headers })
: respond({ value: 17 }, { headers });
}
- Register
readas a GET server function namedconditional. From a Chrome page, callGET(createServerReference("conditional"))()twice. Chrome sends If-None-Match on the second request; application code sets no conditional header.
Expected behavior
Expected: Both decoded results are { value: 17 }.
Actual: The second result is undefined, although Chrome replays the cached body as status 200.
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 on HEAD and rc.13; HEAD also fails with observe (production runtime plus optional instrumentation).
Additional context
A 304 response reuses the cached body. Replacing its representation header without replacing the body makes the decoder consume the wrong format.
Development additionally warns that a scripted call returned 304, despite the browser-generated conditional request.
Full automated reproduction
One-command setup, run and expected output.
Copy the standalone folder into a fresh Bun project. The visible source above is executed by these tests; the additional files supply the required HTTP, compilation, and browser setup.
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 ./repro.test.ts
The link command selects a built Solid HEAD checkout; omit it for rc.13. Repeat with BUILD_MODE=production for the production comparison. Browser tests use system Google Chrome.
- Lingua principale
- TypeScript
- Stelle
- 36.1k
- Fork
- 1.1k
- Merge medio
- 11h 25m
- PR unite (30g)
- 345
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à 4/5 3-5 giorni Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
I maintainer di solito rispondono entro 1 giorno
-
Select loses its bound value when options load asynchronouslyForse già presa @MokiMeow l’ha presa oggi. Aperta
Difficoltà 3/5 Mezza giornata Idoneità per principianti 45/100
solidjs/solid#3928 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 18/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 24/100
solidjs/solid#3923 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di solidjs/solid
Issue simili
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
core
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
vectorize-io/hindsight#5457 ·
I maintainer di solito rispondono entro 1 giorno
-
beginner friendly community contributions-welcome good first issue hacktoberfest help wanted testing up-for-grabs
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
lukilabs/beautiful-mermaid#160 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
rescript-lang/rescript-lang.org#1420 ·
I maintainer di solito rispondono entro 2 giorni