Skip to content

launch: check a new app name once, not twice - #5317

Open
jphenow wants to merge 1 commit into
masterfrom
jphenow/launch-single-name-check
Open

jphenow wants to merge 1 commit into
masterfrom
jphenow/launch-single-name-check

Conversation

@jphenow

@jphenow jphenow commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

What this gets us

fly launch with a new app name looks the name up once instead of twice, saving about five seconds. flaps retries its app lookup for about five seconds before it answers 404, so every lookup of an unused name costs that much.

Approach

determineAppName first calls nudgeTowardsDeploy, whose GetApp is GET /v1/apps/<name>, then appNameTaken, whose fly-go AppNameAvailable sends the same GET. nudgeTowardsDeploy now also reports when its lookup returned 404 (errors.Is(err, flaps.ErrFlapsNotFound), the same status check AppNameAvailable uses), and the second call is skipped then. A 403, any other error, and --yes still go through appNameTaken.

Context

🤖 Generated with Claude Code

determineAppName asked flaps for the app twice in a row: once in nudgeTowardsDeploy to see whether the user already owns it, then again through AppNameAvailable, which is the same GET /v1/apps/<name>. flaps retries its app lookup for about five seconds before returning 404, so a new name cost about ten seconds. When the first lookup returns 404 the name is free and the second request is skipped; every other outcome still goes through the availability check.
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