fix: keep token-key casing, bound lookups, fail a degraded warmup - #56
Open
matheus1lva wants to merge 1 commit into
Open
fix: keep token-key casing, bound lookups, fail a degraded warmup#56matheus1lva wants to merge 1 commit into
matheus1lva wants to merge 1 commit into
Conversation
Closed-day responses were immutable, so a repair stayed invisible to browsers for a year. Cache keys folded casing and dropped a second spelling's timestamps. Spot could hang past the worker deadline, and warmup stayed green while per-item errors were swallowed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closed-day historical responses used
Cache-Control: immutable, so a backfill or repair stayed invisible to browsers for a year. Edge cache keys lowercased token addresses, which mixed callers' echoed keys and collapsed two spellings that carried different timestamp lists. Spot could wait on a stalled Enso socket until the platform killed the worker. Warmup swallowed per-item errors and left the schedule green.Changes
public, s-maxage=31536000, max-age=3600, stale-while-revalidate=86400.[start, end]).UNAVAILABLEsetsno-storeon the whole response.parseTokenKeyand bad addresses throwINVALID_INPUT(400). Timestamps must be unix seconds from 0 through4102444800; millisecond and non-integer values 400.Risk / observable output
s-maxageand is purgeable.{lower:[t1], checksum:[t2]}returns t1 under lower and t2 under checksum, not the union under both.no-store. PermanentNOT_FOUNDstill uses the 120s spot policy.Test plan
vitest run test/prices-batch-range.test.ts: 18 passed, including the merge-across-spellings cases (watched RED then GREEN).AbortSignal.timeout(5000)plus transport retry, spot deadline/no-store, historical 400 for bad address/chain/out-of-bounds timestamp, warmup degraded predicate.Not run here:
tsc, full suite, live Enso, prod-shaped DB / live RPC.20 files, +436 / -110.