fix(traffic): re-read splits before reconciling, and stop the self-deploy stealing forgegraf.com #475
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
gmackie/ForgeGraph!475
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/reconcile-stale-split"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Two fixes for the same story: hostname ownership, both found by live evidence within hours of #458 deploying.
1. Re-read a split before reconciling it
reconcileEnabledSplitHostnameslisted enabled splits once per sweep, then acted on that snapshot. A Cloudflare round-trip for an earlier split gives a concurrent enable/disable time to land; acting on the stale row means moving a hostname back onto a routerdisablehas already deleted. The move detaches the hostname before re-attaching, so only restore-on-failure keeps the site serving.Observed live 2026-08-26 while retiring a duplicate
latchflow-betaapp:traffic.disabledat 18:26:34, the sweep acted at 18:26:39 and 404'd attachingbeta.latchflow.ioto the just-deletedlatchflow-beta-router. The restore held (302 throughout) — but a failed restore there is precisely the habitplay.io dark-hostname failure mode.Each split is now re-read immediately before its Cloudflare calls and skipped if it is no longer
enabled, no longer in a reconcilable state, has no hostnames, or has just changed state. The allowed-state list is hoisted toRECONCILABLE_STATESso the query and the guard cannot drift.2. Stop our own deploy stealing forgegraf.com
deploy.ymlranopennextjs-cloudflare deploy --domain forgegraf.com, which re-attached the apex to theforgegrafworker on every self-deploy — pulling it offforgegraph-router. So between each deploy and the next reconcile sweep, ForgeGraph silently bypassed its own one-box canary, and the swap left the hostname attached to nothing in between.Evidence: four
traffic.hostnames_reconciledevents forforgegraf.comon 2026-08-26 alone (09:52, 15:41, 16:31, 18:21), the last one a re-create rather than a move — i.e. the apex was attached to no worker when the sweep found it. The router reaches the worker through a service binding, so it needs no hostname of its own.This is the production-deploy steal-back case #458 predicted, with the platform itself as the offender.
17/17 lifecycle + 41/41 router tests green (new: "skips a split that was disabled between the listing and the sweep"); tsc clean.
🤖 Generated with Claude Code
https://claude.ai/code/session_01CMpzX1b6swjezEptw3T71f
fix(traffic): re-read a split before reconciling its hostnamesto fix(traffic): re-read splits before reconciling, and stop the self-deploy stealing forgegraf.com