Skip to content

fix(platform): preserve immutable cached asset responses - #334

Merged
Brooooooklyn merged 3 commits into
mainfrom
codex/fix-dispatch-cached-assets
Sep 22, 2026
Merged

Brooooooklyn merged 3 commits into
mainfrom
codex/fix-dispatch-cached-assets

Conversation

@Brooooooklyn

@Brooooooklyn Brooooooklyn commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

Problem

After a platform rollout, existing projects can return HTTP 500 for cached hashed assets without an application redeploy. Commit 5c0b5ba added a header deletion in finalizeAsset, but Cloudflare Cache API responses have immutable headers. When no header rule matches, applyHeaderRules returns that original response and the deletion throws Can't modify immutable headers.

The actual dispatcher reproduces this in Miniflare/workerd: the first request returns 200, then cache hits return 500. This matches the affected voidzero.dev routing and reported recovery after platform rollback; historical incident logs were unavailable, so incident attribution remains based on the reproduction and configuration.

Change

Remove the internal shared-cache marker from the writable client response already constructed by meter. Preserve the marker in the stored cache entry and avoid modifying the immutable cached response.

Add real Workers Cache API regressions under platform/packages/dispatch/test/runtime/, covering absent, unmatched, and matched header rules. Each verifies repeated cache hits, unchanged origin request counts, response content and caching headers, and removal of the internal marker. The existing mutable response mocks did not expose this failure.

The regressions run in the existing platform-unit project and Platform CI. The dispatch typecheck command checks the Node-based runtime harness separately from the Worker source to keep their global types isolated.

Validation

  • Before the fix, the new no-rule and unmatched-rule cases fail with HTTP 500; all three cases pass after the fix.
  • Focused dispatcher/runtime tests: 256 passed. vp test run --project 'platform-*' platform/packages/dispatch/test/runtime/asset-cache.test.ts also passes all three runtime cases at their final location.
  • Platform and SDK typechecks, platform type-aware lint, focused lint, formatting, and diff checks pass.
  • Full tests: 551 files passed, 10,413 tests passed, 47 skipped; one integration suite failed during setup because local migration state references missing 20260913054327_elite_betty_ross.sql.
  • vp run check remains blocked by a missing compiler dependency in the ignored local playground-local/deploy-verify app. This blocker is outside the changed code.

No production deployment or app redeployment was performed.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-22T14:07:35.022776Z 84d7791 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7e13837dbe

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/void/test/unit/platform-dispatch-assets.test.ts Outdated
@Brooooooklyn
Brooooooklyn enabled auto-merge (squash) September 22, 2026 14:01
@Brooooooklyn
Brooooooklyn merged commit a6f497c into main Sep 22, 2026
18 checks passed
@Brooooooklyn
Brooooooklyn deleted the codex/fix-dispatch-cached-assets branch September 22, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant