Repository navigation
fix: close the 12 hacks and 5 bugs the comment purge surfaced - #74
Merged
Merged
Conversation
…stead of hard-coding 1184 Closes #56
…args by value Closes #58
resolveMotion in shared/motion.ts is the only statement of the rule; prefs.ts calls it, page-lifecycle.ts asks prefs.ts, and MOTION_BOOTSTRAP splices in its source, so the inline string and its CSP hash share it. Closes #62
…ad of copying them satori cannot resolve CSS custom properties, so og.ts and badge.ts kept hex copies of the palette. The share card's copy had drifted: line and ink-faint still held the values from before they were lifted for contrast. Both COLOR objects now come from loadPalette, which reads the --color-* tokens from src/styles/global.css at generate time and throws on a missing one. palette.ts and global.css join the card generator's LAYOUT_SOURCES so a palette change redraws every card. Closes #64
…s.ts THIRD_PARTY_NOTICES.md carries Lucide's license verbatim (ISC, with the MIT notice for its Feather-derived icons), Simple Icons' CC0 and the Rust mark's CC BY-SA 4.0 for src/lib/brand-marks.ts, world-atlas's ISC notice and Natural Earth's public-domain status for src/lib/world.ts, and the SIL OFL 1.1 for the Geist TTFs in src/assets/fonts. README links to it. Closes #72
… sampling getSession Closes #65
…a hardcoded 8 UsageBar draws its own pending skeleton with the loaded legend's classes and one entry per kind in KIND_LABEL; FilesUsage passes it as the fallback. Closes #55
…editor preview Footnote, code-frame spacing and Expressive Code variable styles move to src/styles/post-body.css, imported by the post page and /blog/edit; the preview carries post-body. A bare pre gets Expressive Code's frame metrics; highlighting stays server-only (see ADR-0172). Closes #66
…d the right Content-Range Move span() from the upload Worker into shared/bucket-http.ts and use it in the download route, which read a suffix range as an offset. Closes #68
… unreadable Read refusals answer from one REFUSALS table in shared/visibility.ts, used by both the meta and download routes. Closes #69
…load Worker's route shared/security.test.ts parses wrangler.jsonc and workers/upload/wrangler.jsonc and fails when either names a different bucket origin than BUCKET_ORIGIN. Closes #70
… at the edge edgeCached now returns an answer whose cache-control carries no-store or private as sent, without storing it, whatever its status. Closes #71
- stats skeletons stay up for a year newer than the build - the shell prompt counts a wide working directory by columns - edgeCached keeps caller headers on a response it refuses to store - /api/files/download answers an unsatisfiable range with 416, and span() gives no range for zero bytes - upload.rcn.sh answers a path naming no key with the shared 400 - palette.ts resolves global.css from its own location - the motion bootstrap writes its rule out, pinned to resolveMotion by test
A transient R2 error with a Range header is rethrown instead of looking like a bad range, a zero-byte suffix is unsatisfiable rather than an empty 200, and every 416 carries bytes */size. edgeCached keeps caller headers on a non-2xx answer, and the upload Worker's bad-request refusal is uncached.
…usal span() gives no range for zero bytes again, so a range R2 accepts but that selects nothing is a 416 naming the size. Only R2's own range refusal (10039) is a 416, a refused range on a missing key is a 404, and every upload.rcn.sh refusal carries uncachedError.
Both readers of bucket bytes now ask shared rangeOutcome whether to send the whole object, a span or a 416. A malformed, multi-part or other-unit Range is ignored, the unit is case-blind, a 416 carries no object headers and cancels the body, a head() failure after a range refusal surfaces, and a 412 cannot be cached.
The readers parse the Range header themselves and pass R2 an explicit offset/length or suffix, so a malformed, reversed or multi-part header serves the whole file instead of reaching R2 and coming back as a 416. Every /api/files/download refusal is uncached and nosniff.
R2 keeps its own HTTP range parsing and clamping; the readers only decide whether a header reaches it. A reversed, multi-part, oversized or zero suffix range is ignored or refused locally, and the bucket-unbound 503 is uncached too.
…e range rules in ADR-0039
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.
The comment purge (#67) left 12 hacks that comments used to excuse, filed as issues labelled
excuse, and 5 bugs found along the way. This PR fixes all 17. Each issue has its own commit. Each fix is proved by a test that failed before it, or by a Playwright before-and-after where the change is visual.Closes #55, closes #56, closes #57, closes #58, closes #59, closes #60, closes #61, closes #62, closes #63, closes #64, closes #65, closes #66, closes #68, closes #69, closes #70, closes #71, closes #72.
Summary
Both readers of bucket bytes (upload.rcn.sh and
/api/files/download) now make every Range decision inshared/bucket-http.ts(rangeToAsk,rangeOutcome). ADR-0039 has the rules.If-Rangeand a 304 on the download route were already missing before this PR; they are #73.Evidence
main, for examplegrep astro astroprinting nothing, a zero-byte suffix giving an empty 200, and two share-card colours (line,inkFaint) that had drifted fromglobal.css.After:
npm testpasses 540 of 540,npm run lintandnpx astro check(0 errors) are clean, and on this branch a fullnpm run buildpassedcsp-union(37 hashes) andverify-headers./and/musicat 1440px and 390px, the/filesusage tile is the same height held and loaded, and a 2027 year option appears on/music/stats.wrangler dev: every page returns 200 and/cdn-cgi/handler/scheduleddeletes only the expired session.Proof: the tests above, Playwright on the dev server, and a smoke run of the built worker under local
wrangler dev. The last full build is from before the final range commits, which touch only server routes; this PR's Workers Builds check covers the rest.Merge Danger
Door: two-way
The site Worker's entry becomes
src/worker.ts(maininwrangler.jsonc) so it can exportscheduled, and a daily cron is added (17 4 * * *). Every share card is redrawn with the palette's real colours.Blast Radius: deploy
npm run deploydoes not deploy upload.rcn.sh. Its range and refusal changes go live only afternpm run deploy:upload.Created with Claude Opus 5.5 in T3 Code over Claude Code.