Skip to content

fix(polling): move spinner from stderr to stdout to prevent consola collision#533

Merged
BYK merged 1 commit intomainfrom
byk/fix-spinner-stderr-collision
Mar 23, 2026
Merged

fix(polling): move spinner from stderr to stdout to prevent consola collision#533
BYK merged 1 commit intomainfrom
byk/fix-spinner-stderr-collision

Conversation

@BYK
Copy link
Copy Markdown
Member

@BYK BYK commented Mar 23, 2026

The spinner animation (withProgress/poll/startSpinner in polling.ts) writes to stderr using \r\x1b[K + braille frames. Consola is also configured to write exclusively to stderr. When log.info() fires inside a withProgress callback — e.g. "Applied delta patch" during sentry cli upgrade — it appends directly after the spinner text on the same line:

⠹ Downloading 0.20.0-dev.1774273283...ℹ Applied delta patch (74.9 KB downloaded)

Fix

Move the spinner from process.stderr to process.stdout. Since consola writes to stderr and the spinner now writes to stdout, the two streams no longer collide.

Also adds isPlainOutput() suppression to both withProgress() and poll() so the spinner is hidden when stdout is piped or in plain-output mode, preventing ANSI escape codes from reaching pipe consumers.

Changes

  • src/lib/polling.ts: Move all spinner writes from stderr → stdout, add isPlainOutput() guard
  • test/commands/issue/utils.test.ts: Update two spinner tests to spy on stdout instead of stderr, set SENTRY_PLAIN_OUTPUT=0 to force rich output in non-TTY test env

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 23, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


Bug Fixes 🐛

Event

  • Detect org/ISSUE-SHORT-ID in event view single-arg path (CLI-9K) by BYK in #529
  • Auto-redirect issue short IDs in event view (CLI-JR) by BYK in #524

Other

  • (api) Strip api/0/ prefix and exclude NodeSystemError integration (CLI-K1) by BYK in #523
  • (dashboard) Add missing datasets to agent guidance by betegon in #522
  • (docs) Overscroll popup — curl command + click-to-copy by betegon in #531
  • (polling) Move spinner from stderr to stdout to prevent consola collision by BYK in #533
  • Handle invalid URLs gracefully in response cache (CLI-GC) by BYK in #528
  • Avoid double-prefixing in buildCommandHint for slashed args (CLI-8C) by BYK in #527
  • Handle full short IDs and numeric IDs in multi-slash issue args (CLI-KC, CLI-B6) by BYK in #526
  • Auto-recovery for wrong entity types across commands (CLI-G6, CLI-K6, CLI-JR) by BYK in #525

Documentation 📚

  • (init) Add documentation and experimental notice for sentry init by betegon in #530

Internal Changes 🔧

  • Regenerate skill files by github-actions[bot] in 22b5281d

🤖 This preview updates automatically when you update the PR.

@BYK BYK marked this pull request as ready for review March 23, 2026 17:36
…ollision

Move the spinner animation in startSpinner/withProgress/poll from
process.stderr to process.stdout. Consola is configured to write
exclusively to stderr, so when log.info() fires inside a withProgress
callback (e.g. "Applied delta patch" during upgrade), it appends
directly after the spinner text on the same stderr line, producing
garbled output like:

  ⠹ Downloading 0.20.0-dev...ℹ Applied delta patch (74.9 KB downloaded)

With the spinner on stdout and consola on stderr, the two streams no
longer collide.

Also adds isPlainOutput() suppression so the spinner is hidden when
stdout is piped or in plain-output mode, preventing ANSI escape codes
from contaminating pipe consumers.
@BYK BYK force-pushed the byk/fix-spinner-stderr-collision branch from d4eaf17 to 607f817 Compare March 23, 2026 17:51
@github-actions
Copy link
Copy Markdown
Contributor

Codecov Results 📊

126 passed | Total: 126 | Pass Rate: 100% | Execution Time: 0ms

📊 Comparison with Base Branch

Metric Change
Total Tests
Passed Tests
Failed Tests
Skipped Tests

✨ No test changes detected

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 1072 uncovered lines.
✅ Project coverage is 95.83%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    95.81%    95.83%    +0.02%
==========================================
  Files          185       185         —
  Lines        25679     25681        +2
  Branches         0         0         —
==========================================
+ Hits         24603     24609        +6
- Misses        1076      1072        -4
- Partials         0         0         —

Generated by Codecov Action

@BYK BYK merged commit 00e1e78 into main Mar 23, 2026
22 checks passed
@BYK BYK deleted the byk/fix-spinner-stderr-collision branch March 23, 2026 17:58
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