site deploy: finalize through the session id the create returned - #602
Merged
Conversation
Two deploys of one commit share a deployment id — it is derived from the commit — so they also share the upload session it addresses, and the loser of a create race finalizes against whatever the winner wrote last. The platform now hands back a per-attempt session_id at create; passing it to finalize resolves this run's own uploads. Both directions stay compatible: session_id is optional on the create response, so a CLI newer than its platform sends nothing and gets the commit-derived session, and an older CLI (the one pinned in today's sandbox images) is unaffected. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G1E31AZvYBa86zpcYJFD1g
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G1E31AZvYBa86zpcYJFD1g
Contributor
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.1.11-pr.602.9833770Prefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.1.11-pr.602.9833770"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.1.11-pr.602.9833770"
}
}
Preview published to npm registry — try new features instantly! |
The optionality was protecting nobody. The static lane is gated by BASE44_STATIC_DEPLOYMENTS, which only the sandbox publish path sets, and nothing else in the platform calls the deployments API — so there is no client that both reaches this code and lacks a session. A platform that opens none is a mismatched deploy, and failing on it beats silently finalizing into the commit-derived session two siblings share. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G1E31AZvYBa86zpcYJFD1g
netanelgilad
commented
Aug 18, 2026
The platform always opens a session, so there was nothing to tolerate — the testkit type is required again and the negative spec is gone. The remaining session assertion folds into the happy-path deploy test rather than standing as a near-duplicate of it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G1E31AZvYBa86zpcYJFD1g
The server no longer keeps a commit-derived session alongside the per-attempt one, so two deploys of a commit share only the deployment id. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G1E31AZvYBa86zpcYJFD1g
DolevEpshtein
approved these changes
Aug 30, 2026
netanelgilad
pushed a commit
that referenced
this pull request
Aug 30, 2026
Integrates the session id main's #602 added to the deployments protocol: create returns `session_id` and finalize now addresses this attempt's uploads through it, so the cf arm threads `created.sessionId` into `finalizeDeployment` alongside the static arm. Conflicts resolved in docs/deployments.md (both arms plus session_id) and core/site/schema.ts (kept sessionId alongside the cf/s3 upload union).
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.
Note
Description
A deployment id is derived from the commit, so two deploys of the same commit address the same deployment — the loser of a create race finalizes against whatever the winner's uploads left behind. The platform now returns a per-attempt
session_idfromPOST deployments; this PR threads it back as?session_id=on finalize so each run resolves its own uploads. Pairs with base44-dev/apper#20445 on the platform side.Related Issue
Pairs with base44-dev/apper#20445 (platform side). No GitHub issue in this repo.
Type of Change
Changes Made
CreateDeploymentResponseSchemagains a requiredsession_id, transformed tosessionIdalongsidedeploymentId(packages/cli/src/core/site/schema.ts).finalizeStaticDeploymentandpostFinalizenow take asessionIdand send it assearchParams: { session_id }onPOST deployments/{id}/finalize(packages/cli/src/core/site/api.ts).deployStaticSitethreadscreated.sessionIdfrom create through to finalize (packages/cli/src/core/site/static-site.ts).TestAPIServercaptures finalize query strings in a newfinalizeQueriesarray (it previously captured only multipart fields), and itsDeploymentCreateResponseshape carriessession_id.static_site_deployments.spec.tsmocks a session id on create and asserts finalize sends it:expect(t.api.finalizeQueries[0]).toEqual({ session_id: SESSION_ID }).docs/deployments.mdupdated to documentsession_idin the create response, the?session_id=finalize param and why it exists, and the newfinalizeQueriestestkit capture.Why `session_id` is required, not optional
An earlier revision made it optional so a newer CLI would degrade against an older platform. There is nothing to tolerate: the static lane is gated by `BASE44_STATIC_DEPLOYMENTS`, set in exactly one place on the platform (the sandbox publish path) behind the currently-closed `sandbox-cli-static-publish` flag, and nothing else calls the deployments API. Public `base44 site deploy` users take the legacy tar.gz path and never reach this code.
Testing
Checklist
Additional Notes
Recorded run from when the change landed on the branch: `bun run test static_site_deployments` — 14 passed. It was not re-run for this description pass. The session assertion lives in the existing happy-path deploy test rather than a standalone case, which would have been setup-identical. Making `session_id` required also forced every mocked create in the spec to carry one — the schema doing its job.
Full-suite caveats from that same run, both verified pre-existing on clean `main` and not introduced here: `bun run typecheck` reports 6 errors in `src/cli/dev/dev-server/function-bundler.ts` (identical count with the change stashed), and `bun run test` fails 25 tests in `dev.spec.ts` / `exec.spec.ts` because `deno` is not installed in that environment.
🤖 Generated by Claude | 2026-08-30 11:57 UTC | c0623af