Skip to content

Fix 'Spinner is already running' error when creating sites via CLI - #3093

Merged
epeicher merged 1 commit into
trunkfrom
fix-site-create-spinner-already-running
Apr 15, 2026
Merged

Fix 'Spinner is already running' error when creating sites via CLI#3093
epeicher merged 1 commit into
trunkfrom
fix-site-create-spinner-already-running

Conversation

@epeicher

Copy link
Copy Markdown
Contributor

Related issues

  • Related to STU-1473 (this fix addresses a bug exposed by the ora → picospinner migration)

How AI was used in this PR

AI assisted with tracing the bug to its two contributing commits (27a1545b introduced the unbalanced reportStart; e3c99cf8 made it observable by swapping ora for picospinner) and drafting the fix.

Proposed Changes

  • In apps/cli/commands/site/create.ts, the runCommand() dependency-check block called logger.reportStart(CHECKING_DEPENDENCY_UPDATES, …) but never called a matching reportSuccess on the happy path. Under ora, a second start() was a no-op; under picospinner, it throws Spinner is already running., failing site create with a confusing error.
  • Call logger.reportSuccess(__('Dependencies up to date')) after updateServerFiles() resolves.
  • In the catch branch, use logger.reportError(error, false) in development (non-fatal, stops spinner) and a silent logger.reportSuccess(…, true) in production so the spinner is always cleared before the next reportStart.

Testing Instructions

  1. npm run cli:build
  2. node apps/cli/dist/cli/main.mjs site create --path ~/Studio/test-site-new
  3. Fill in the prompts (name, WP version, PHP version, etc.).
  4. Confirm the site is created successfully and you see ✔ Dependencies up to date followed by ✔ Site configuration validated — no Spinner is already running. error.
  5. To reproduce the pre-fix behaviour, check out trunk and run the same command — it fails on the happy (online) path.
  6. npm test -- apps/cli/commands/site/tests/create.test.ts --run — 46/46 pass.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
The dependency-update spinner in runCommand() was started but never stopped on the success path. Under ora, a second start() was a no-op; under picospinner (STU-1473), it throws. Report success after updateServerFiles() and ensure the catch path also clears the spinner.
@epeicher epeicher self-assigned this Apr 14, 2026
@epeicher
epeicher requested a review from a team April 14, 2026 18:35
@wpmobilebot

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 4eb2ba3 vs trunk

app-size

Metric trunk 4eb2ba3 Diff Change
App Size (Mac) 1286.17 MB 1286.17 MB +0.00 MB ⚪ 0.0%

site-editor

Metric trunk 4eb2ba3 Diff Change
load 1549 ms 1895 ms +346 ms 🔴 22.3%

site-startup

Metric trunk 4eb2ba3 Diff Change
siteCreation 9124 ms 9124 ms 0 ms ⚪ 0.0%
siteStartup 4954 ms 4943 ms 11 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

@bcotrim bcotrim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching the error!
LGTM 👍

@epeicher
epeicher merged commit 57328c3 into trunk Apr 15, 2026
10 checks passed
@epeicher
epeicher deleted the fix-site-create-spinner-already-running branch April 15, 2026 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants