Skip to content

fix(auto-routing): post owner pool conversions with a redirect mode Workers accept - #8098

Merged
iscekic merged 1 commit into
mainfrom
fix/owner-pool-conversion-redirect
Oct 19, 2026
Merged

iscekic merged 1 commit into
mainfrom
fix/owner-pool-conversion-redirect

Conversation

@iscekic

@iscekic iscekic commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

The silent pool conversion could not write anything in production. The first --apply page aborted with batch_failed, and no rows were created.

Cause

postOwnerPoolConversions called fetch with redirect: 'error'. The Workers runtime rejects that value with a TypeError before it opens a connection, and the function's catch returned null without a trace. The dry run never posts, and the unit tests run in Node with a mocked fetch, so neither caught it. The same function backs migrateOwnerPoolForSettings, so pool saves that should convert also returned no outcome.

Changes

  • Use redirect: 'manual'. A 3xx response is not ok, so the internal secret still never follows a redirect and the batch fails closed. A test covers a 307 response.
  • Log every failed post (auto_routing_owner_pool_conversion_post_failed) with its stage, status and batch size. No headers, secret or owner payload are logged.
  • The operator script accepts null for the optional fields of Cloudflare API responses. The object listing returns errors: null, which failed the dry run at its first request.

Verification

  • services/auto-routing: owner-pool-conversion.test.ts passes, and typecheck and oxlint pass.
  • Reproduced the runtime error with the repository's workerd version and compatibility date: redirect: 'error' throws, redirect: 'manual' passes option validation.

@kilo-code-bot

kilo-code-bot Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • services/auto-routing/src/owner-pool-conversion.ts
  • services/auto-routing/src/owner-pool-conversion.test.ts
  • services/auto-routing/scripts/convert-owner-pools.ts

Reviewed by deepseek-v4.1-flash-1017 · Input: 51.9K · Output: 9.8K · Cached: 488.7K

Review guidance: REVIEW.md from base branch main

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.

2 participants