#8464 All scripts in an account are being listed during DO migrations
Upstream API limitation - migration_tag only available on list scripts endpoint, not on script details/settings. Maintainer acknowledged, requested internal Jira ticket for API team.
Follow up on internal Jira ticket status; monitor for API update to add migration_tag to script details endpoint
Analysis Report
Issue #8464: All scripts in an account are being listed during DO migrations
Summary
| Field | Value |
|---|---|
| Issue | #8464 |
| Title | All scripts in an account are being listed during DO migrations |
| State | OPEN |
| Created | 2025-03-13 |
| Updated | 2025-10-30 |
| Labels | bug, durable objects |
Problem Description
The issue reports that during Durable Object migrations, Wrangler lists all scripts in an account to find the migration_tag for a specific script. This happens in packages/wrangler/src/durable.ts (lines 65-68):
const scripts = await fetchResult<ScriptData[]>(
config,
`/accounts/${accountId}/workers/scripts`
);
script = scripts.find(({ id }) => id === scriptName);
This causes:
- Slow lookups for accounts with many Worker scripts
- Potential 504 timeouts
- May not find the script if the endpoint has an inherent limit
Analysis
Code Status
The problematic code is still present in the current codebase. Recent commits to durable.ts were only refactoring changes (renaming, utility extraction) - none addressed this performance issue.
Maintainer Comments
- @threepointone (original author): Confirmed that at the time the code was written, there was no other way to get the
migration_tag. He noted that neither the script details endpoint nor the settings endpoint returns migration details - only the list scripts endpoint does. - @emily-shen: Acknowledged this is primarily an API limitation and requested an internal Jira ticket be created for the API team. She indicated this wrangler issue would remain open to track switching the implementation when the API is updated.
Related PRs
No PRs have been submitted to fix this issue.
Changelog
Issue #8464 is not mentioned in the changelog.
Root Cause
This is an upstream API limitation. The Cloudflare API does not expose migration_tag on the individual script details or settings endpoints - it's only available on the list scripts endpoint.
Recommendation
Keep Open - This issue is a valid bug/performance issue that:
- Has been confirmed by maintainers as a legitimate problem
- Is blocked on an upstream Cloudflare API change (adding
migration_tagto script details/settings endpoints) - Has been triaged appropriately - maintainer requested an internal Jira ticket for the API team
- Is being tracked to implement the fix in Wrangler once the API is updated
Suggested Actions
- Follow up on whether the internal Jira ticket was created
- Periodically check if the Cloudflare API has been updated to include
migration_tagin script details/settings endpoints - Once the API is updated, implement the fix to use a direct script lookup instead of listing all scripts
Confidence
High - Clear maintainer acknowledgment and documented API limitation.
Notes & Feedback (0)
No notes yet.