Skip to content
Source
Sign inSign up
TanStack/schemas

Docs cache: two call sites can still share a key through a helper's url parameter #752 (GitHub #751)

Opentombeckenham opened this issue 0 comments
tombeckenhamcommented

Problem

The BytePlus poll failed for 1h45 on 2026-11-21 because two parsers cached different shapes under one docs-cache key (#744). The guard added there, src/server/providers/docs-cache-keys.test.ts, compares key expressions as written: it cannot see two constants holding the same URL, or a helper that takes a url parameter. cachedGoogleDocs (google-docs.ts) also has its own miss path with no JSON round-trip.

Ask

Make a collision impossible, not just tested: for example have each cached parse declare a name that goes into the key, or validate the cached shape on read with the parser's own schema and treat a mismatch as a miss that is reported.

Acceptance

  • A test that caches two shapes at one URL through a helper fails loudly at the read, not with a TypeError in the caller.

Sign in to join this conversation.