Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[2.0 rc.13 + next] 304 format header overwrites cached GET representation

Chiusa
#3,897 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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

Standalone reproduction

Steps to Reproduce the Bug or Issue
  1. 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 });
}
  1. Register read as a GET server function named conditional. From a Chrome page, call GET(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/web next at 3086f1b77cd7b0431d3a7f768c2984c335758633; comparison 2.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.

Related: #3101, #3134

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

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di solidjs/solid

Tutte le issue di solidjs/solid

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.