Skip to content

Keep polling dev store creation when the status read comes back empty - #9024

Merged
alexanderMontague merged 1 commit into
mainfrom
dev-store-poll-replica-lag
Oct 28, 2026
Merged

alexanderMontague merged 1 commit into
mainfrom
dev-store-poll-replica-lag

Conversation

@alexanderMontague

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

shopify store create dev intermittently fails with "Unable to determine store creation status." right after the store is created.

The CLI polls Business Platform's organization.storeCreation(shopDomain:) immediately after createAppDevelopmentStore returns. BP routes Organizations GraphQL queries to a read replica by default, so when replication lags behind the write that created the StoreCreation record, the query returns storeCreation: null. The CLI treated an empty status as fatal and aborted on the very first poll, even though the store was being created (and usually finished a few seconds later).

On 2026-10-26, BP replica lag rose to 3–5 s peaks during a schema migration, and about half of CLI dev store creations failed this way, on every CLI version. The Dev Dashboard / admin-web store creation flow reads the same replica but didn't fail, because it treats a missing status as pending and keeps polling.

WHAT is this pull request doing?

  • Treats a missing storeCreation status (or a missing organization) as still pending, shows "Waiting for store creation to start", and keeps polling every 2 s until the existing 5-minute timeout. This matches admin-web's behaviour.
  • COMPLETE still returns, and FAILED / TIMED_OUT / USER_ERROR still fail immediately, including when they show up after empty reads.
  • If no status is ever reported before the timeout, the error says so and adds a next step: check whether the store was created with shopify store list before trying again.
  • Adds a patch changeset for @shopify/cli.

A server-side fix (route storeCreation to BP's writer, via WRITER_REQUIRED_FIELDS) would also help every client. That's separate, and this CLI change is worth having either way.

How to test your changes?

  • pnpm vitest run packages/organizations/src/cli/services/dev/create-dev-store.test.ts. The new tests cover empty reads followed by COMPLETE, a terminal status after an empty read, and a timeout with no status ever reported. The three new tests fail on main.
  • Manually: shopify store create dev against an org. While BP replica lag is elevated, the spinner shows "Waiting for store creation to start" for a moment and then carries on, instead of failing.

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • Changeset added

Requested by Alex Montague [email protected]

`store create dev` polls Business Platform's `storeCreation` right after
the create mutation returns. Business Platform serves that query from a
read replica, so when the replica lags behind the write, the store
creation record isn't there yet and the status comes back empty. The CLI
treated that as fatal and aborted with "Unable to determine store
creation status." on the first poll, even though the store was being
created.

Treat a missing status as still pending and keep polling until the
existing 5-minute timeout, the way the admin's store creation flow (used
by the Dev Dashboard) already does. Terminal statuses still fail at once.
If no status ever appears before the timeout, the error says so and
points to `shopify store list` to check whether the store was created.

Co-authored-by: Alex Montague <[email protected]>
@github-actions github-actions Bot added the Area: @shopify/cli @shopify/cli package issues label Oct 27, 2026
@alexanderMontague
alexanderMontague marked this pull request as ready for review October 27, 2026 13:50
@alexanderMontague
alexanderMontague requested a review from a team as a code owner October 27, 2026 13:50
@alexanderMontague
alexanderMontague added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit d92c0a0 Oct 28, 2026
30 checks passed
@alexanderMontague
alexanderMontague deleted the dev-store-poll-replica-lag branch October 28, 2026 12:53
jplhomer pushed a commit that referenced this pull request Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: @shopify/cli @shopify/cli package issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants