agent preview deploy overwrote production routes: route collision
Fixes preview deploys colliding with production routes. Use when previews steal prod traffic. Key trigger: prod traffic hitting preview.
agent preview deploy overwrote production routes: route collision
TL;DR
The preview deploy's routes overlapped production's, so preview stole prod traffic (or vice versa). Scope preview routes to preview hostnames only, never overlapping prod patterns. Previews must be incapable of matching prod traffic.
agent preview deploy overwrote production routes: route collisionSteps
Identify the overlapping route patterns. Expected: The collision is mapped.
Restrict preview routes to preview-only hostnames/paths. Expected: The overlap is gone.
Verify prod traffic routes correctly and preview is isolated. Expected: Both serve correctly.
Add a route-collision check to the preview pipeline. Expected: Collisions are caught pre-deploy.
Document the route namespacing convention. Expected: The rule is explicit.
When to use
- preview deploys affect production traffic
- routes overlap
- the agent manages previews
When not to use
- the overlap is intentional (canary; then it is not a preview)
- routes are already isolated (check DNS instead)
- the traffic shift is from something else (verify)
Tool compatibility
- wrangler
- preview deployments
Variant phrasings
- "preview deploy route collision"
- "preview overwrote production routes"
- "preview stole prod traffic"
Why it happens
Preview deployments share the routing table namespace, and a preview with a broad pattern matches production hostnames. The preview 'works' while production silently bleeds. Route isolation (preview-only hostnames) is the boundary that keeps experiments experimental.
Edge cases
- the collision check must run against the merged table, not the preview alone
- DNS for preview hostnames must exist or the isolation is theoretical
- the convention needs enforcement; docs alone do not stop broad patterns
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_RMVSq7DyXFp8fO0DhPHU0A