Skip to content

fix(cli): retry post-deploy calls while the new deployment token spreads - #64

Merged
Madraka merged 1 commit into
mainfrom
fix/deploy-token-propagation
Oct 21, 2026
Merged

Madraka merged 1 commit into
mainfrom
fix/deploy-token-propagation

Conversation

@Madraka

@Madraka Madraka commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

cloudhal.com's Workers Build for the 0.3.9 update failed after both Workers had deployed:

Deployed cloudhal-com-admin triggers (1.24 sec)
cloudhal: push failed (401): {"error":"unauthorized","message":"deployment token required"}

Workers Builds makes a new deployment token on every build; for a few seconds after wrangler deploy the edge can still answer from the previous admin Worker version, which has the previous token. The health check passes (it needs no token), then the authenticated push check gets 401.

whileTokenPropagates (deploy/resources.ts) retries a step for up to 90 s while it fails with (401); afterDeploy wraps the push and both primary-domain calls in it. Other failures are not retried.

Tests: token-propagation.test.ts (retries then succeeds, no retry on 500, gives up after the timeout); deploy.test.ts unchanged and green.

🤖 Generated with Claude Code

Workers Builds makes a new deployment token on every build. Right after
`wrangler deploy` the edge can still answer from the previous admin Worker
version, so the push check got 401 and the build failed although both
Workers had deployed (cloudhal.com, 0.3.9 update). The push and the
primary-domain calls after a deploy now retry on 401 for up to 90 s.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Madraka <[email protected]>
@Madraka
Madraka merged commit 37ac0ef into main Oct 21, 2026
4 checks passed
@Madraka
Madraka deleted the fix/deploy-token-propagation branch October 21, 2026 20:40
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