Repository navigation
Conversation
cpojer
pushed a commit
that referenced
this pull request
Sep 11, 2026
…fP (#76) The bug is in the **preflight endpoint** at `packages/api/src/routes/deploy.ts`. It handles the WfP→anything case but **misses the static→WfP case**. ``` CLI API CF Asset API │ │ │ │ 1. preflight(assetManifest) │ │ │─────────────────────────────────────>│ │ │ │ checks previous deploy: │ │ │ has serving manifest? YES (was │ │ │ static) → compares hashes │ │ 2. { needed: [1], skipped: 29 } │ │ │<─────────────────────────────────────│ │ │ │ │ │ 3. deploy(FormData with 1 asset) │ │ │─────────────────────────────────────>│ │ │ │ collectAssets → assetsByHash │ │ │ has 1 entry │ │ │ │ │ │ fills manifest with 29 skipped │ │ │ hashes from previous deploy │ │ │ │ │ │ createAssetUploadSession( │ │ │ 30-entry manifest) │ │ │───────────────────────────────────>│ │ │ │ │ │ buckets: [29 hashes] │ │ │ (CF never had these — they were │ │ │ in KV/R2, not CF asset store!) │ │ │<───────────────────────────────────│ │ │ │ │ │ uploadAssetBuckets(): │ │ │ assetsByHash.get(hash) → null! │ │ │ ═══════ BOOM ═══════ │ │ │ AssetHashMissError │ ``` The design doc states: > Since carried-forward assets already exist in CF's storage, CF won't request them — so we don't need the actual file contents for those. This assumption is correct for same-type deploys but **wrong when crossing storage mechanisms**: | Transition | Previous assets in | New assets go to | Dedup safe? | |---|---|---|---| | static→static | KV/R2 | KV/R2 | Yes | | WfP→WfP | CF Asset API | CF Asset API | Yes (currently forced all-fresh) | | WfP→static | CF Asset API | KV/R2 | Yes (forced all-fresh by existing check) | | **static→WfP** | **KV/R2** | **CF Asset API** | **NO — this is the bug** | The existing code only checks the reverse direction: ```ts // Handles WfP→anything: no serving manifest means previous was WfP → all fresh if (!hasServingManifest) { return c.json({ needed: Object.keys(assetManifest), total, skipped: 0 }); } ``` The CLI now sends `hasWorker: true` in the preflight body for full/framework deploys. The preflight endpoint checks: if previous was static (has serving manifest) AND current has a worker, all assets are returned as needed to force a fresh upload to CF's asset API. Static-to-static dedup remains unaffected. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Reverts #75.
The original fix normalized
schema.pathindiscoverSchema()and usedposix.joinfor@schemaalias resolution. While the approach was correct for module IDs returned fromresolveId, it didn't account for the broader impact:startsWith/===comparisons in watcher callbacksplugin-routing.tsdirectory variables (routesDir,middlewareDir, etc.) which are used for both watcher comparisons and module ID generationprocess.cwd()root, allpath.joinresults used as module IDs, andfileURLToPathresults — rather than patching individual call sitesWill follow up with a comprehensive fix that addresses the full scope.