Repository navigation
feat(apps): reclaim a deleted app ID from bl apps create - #49
Conversation
bl apps create stopped at reserve for a deleted app's ID, and bl apps initialize refused it client-side, so a deleted static site could not be re-created, e.g. as fetch-js with MySQL, under the same URL. When reserve fails and the app turns out to be deleted (newer servers answer app_deleted, older ones app_id_collision), create now reclaims it through initialize, even for a static plan, and reports reclaimed: true. --private is applied after the reclaim because a deleted app has no live route to change. initialize keeps refusing deleted apps and points to create. Signed-off-by: Nandi Wong <nand0315@gmail.com>
c8bbe1e to
1a2a459
Compare
Automated reviewAPPROVE WITH CAUTION — Reclaim flow is correct; one nonblocking issue: on a reclaim, --private is applied only after initialize's response checks pass, so a failed check leaves the reclaimed app public. (per claude) From F1 — [INFO] Reclaim checks initialize's response before applying
|
On a reclaim, --private was applied only after initialize's response passed its app ID and MySQL checks. A 2xx response that failed a check ended the command with the reclaimed app still visible to its workspace. Apply visibility as soon as initialize returns, before those checks. Signed-off-by: Nandi Wong <nand0315@gmail.com>
|
🤖 Thanks, F1 was valid. It's fixed in 656dfa4 (comment).
|
Summary
After
bl apps delete, there was no way to create the same app ID again throughbl:bl apps createstopped at reserve withapp_id_collision.bl apps initializerefused any app withdeleted_aton the client side.So a deleted
staticsite could not be re-created, for example asfetch-jswith MySQL, under the same URL. People created-v2IDs instead.The control plane already reclaims a deleted app ID through initialize, as a fresh lifecycle. squareup/blockplat-compose#667 makes plan and reserve lead clients to that path.
Changes
bl apps create: when reserve fails withapp_deleted(newer servers) orapp_id_collision(older servers), create already inspects the app. If the app is deleted, create now reclaims it through initialize with the planned runtime profile and persistence, and the output reportsreclaimed: true.app_deleted. The error says to wait a few minutes and retry the same command.--privateon a reclaim: visibility is applied after initialize, because a deleted app has no live route to change and the reclaimed route publishes no version. If that step fails, the recovery message points tobl apps visibility <id> privateonly. Retryingcreatecannot resume a reclaimed app.bl apps initialize: still refuses deleted apps. The message now points tobl apps create.README.mdexplain how to reuse a deleted app's ID. Sharing, publishers, versions and data are not carried over.Verification
app_deleted.app_id_collisionwith a no-initialize plan.--privateordering on reclaim.just check(fmt, clippy-D warnings, all tests) passes.Staging verification (bb-block staging, 2026-11-19/20)
The control plane ran blockplat-compose main
277e2141, which includes squareup/blockplat-compose#667, squareup/blockplat-compose#669 and squareup/blockplat-compose#673.blwas built from this branch before the rebase onto main; the rebase only adapted the code to thecreate_apprefactor in #53. Test appreclaim-e2e-1119:bl apps create --runtime-profile staticand deploy. Ready, with an expiration record, so it exercised the static-lifecycle release path.bl apps create --runtime-profile fetch-js --persistence mysql. Plan accepted fetch-js + MySQL (this failed withmysql_profile_unsupportedbefore #667) and reserve answeredapp_deleted. Initialize returned409 app_deleted, and the CLI printed the "cleanup is still finishing, retry" message.reclaimed: true, sameexternal_url,fetch-js+mysql, newapp_incarnation_id.reclaim_ready_atwas never published in the meantime, so initialize's lazy finalization did the work. Not requiringreclaim_ready_aton the client is therefore necessary.bl curlat the original URL:/api/db: MySQL 8.0.42 through the app's proxy./api/db/write: inserted a row./api/db/read: returned the row, and returned it again after a redeploy.Rollout
The server side is merged: squareup/blockplat-compose#667, #669 and #673. Older servers reject the static → fetch-js + MySQL plan with
mysql_profile_unsupported. With an older server, same-profile reclaims still work through theapp_id_collisionfallback.