Skip to content

fix(wrangler): v2 deleted_classes migration — remove SchedulerDO from landing-page worker#772

Merged
biwasxyz merged 1 commit into
mainfrom
fix/scheduler-do-delete-migration
May 12, 2026
Merged

fix(wrangler): v2 deleted_classes migration — remove SchedulerDO from landing-page worker#772
biwasxyz merged 1 commit into
mainfrom
fix/scheduler-do-delete-migration

Conversation

@biwasxyz
Copy link
Copy Markdown
Contributor

What

Adds a v2 Durable Object migration to wrangler.jsonc (all three blocks: top-level, env.production, env.preview) that deletes the SchedulerDO class:

"migrations": [
  { "tag": "v1", "new_sqlite_classes": ["SchedulerDO"] },
  { "tag": "v2", "deleted_classes": ["SchedulerDO"] }
]

Why

During PR #743 experimentation on 2026-05-12, the non-production branch deploy command was temporarily flipped from npx wrangler versions upload to npx wrangler deploy --env preview. Cloudflare Workers Builds overrode the --env preview worker name from landing-page-preview back to landing-page (production), which meant the v1 SchedulerDO migration was applied to the production worker, not the intended preview worker.

Production aibtc.com is currently serving the experimental branch's bundle and has the landing-page_SchedulerDO namespace registered.

Attempted dashboard rollback to a pre-experiment version failed with:

Invalid deployment: The version "5229218f-..." cannot be deployed because it has a resource that was modified: the version depends on Durable Object migration "", but the current deployment is using migration "v1"

This is CF's safety net — rolling back to a version that doesn't know about an applied migration would orphan the DO data.

The fix is a forward migration (v2) that deletes the class, restoring the worker to a clean no-DO state. Once this merges, CI's wrangler deploy applies v2, the SchedulerDO namespace is removed, and aibtc.com runs main's code with no DO baggage.

Test plan

  • Local npm run build passes
  • After merge, CI's wrangler deploy runs cleanly
  • aibtc.com/ returns 200 from main's code (45e70f9 + this commit)
  • aibtc.com/leaderboard shows main's pre-PR-feat(leaderboard): /leaderboard page ranked by MCP-submitted trade count + USD volume #743 leaderboard (browser-side Tenero, no SSR volume)
  • CF dashboard → Workers → landing-page → Durable Objects: landing-page_SchedulerDO namespace is gone
  • No errors in logs.aibtc.com post-deploy

Notes

  • Keep both migration entries declared after this lands; removing v1 would break the next deploy with a similar history mismatch.
  • The actual SchedulerDO class definition + binding never landed on main, so no source-tree cleanup needed here.
  • PR feat(leaderboard): /leaderboard page ranked by MCP-submitted trade count + USD volume #743 remains open; its scheduler work needs to be revisited as a clean follow-up (likely with the class definition inline at the entry point, plus a fresh migration v3 reintroducing it).

🤖 Generated with Claude Code

The `landing-page` Cloudflare worker has migration v1 applied
out-of-band (registered the `SchedulerDO` class during PR #743
experimentation on 2026-05-12). Main's bundle doesn't reference
that class, but CF blocks any deploy or rollback that doesn't
account for v1 — error code from the dashboard rollback attempt:

  "the version depends on Durable Object migration '', but the
  current deployment is using migration 'v1'"

To restore production to a clean no-DO state, ship a forward
migration that deletes the class. v1 has to stay declared so
wrangler can see the full history; v2 does the actual deletion.

Once this merges and CI's `wrangler deploy` runs, the worker
applies v2, removes the SchedulerDO namespace + any orphan DO
state, and aibtc.com runs main's code with no DO baggage.

Keep both migrations declared after this lands — removing v1
would break the next deploy with a similar history mismatch.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@biwasxyz biwasxyz merged commit a0b1676 into main May 12, 2026
7 of 8 checks passed
@biwasxyz biwasxyz deleted the fix/scheduler-do-delete-migration branch May 12, 2026 08:31
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