fix(polling): move spinner from stderr to stdout to prevent consola collision#533
Merged
fix(polling): move spinner from stderr to stdout to prevent consola collision#533
Conversation
Contributor
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. Bug Fixes 🐛Event
Other
Documentation 📚
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
…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.
d4eaf17 to
607f817
Compare
Contributor
Codecov Results 📊✅ 126 passed | Total: 126 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 1072 uncovered lines. 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The spinner animation (
withProgress/poll/startSpinnerinpolling.ts) writes to stderr using\r\x1b[K+ braille frames. Consola is also configured to write exclusively to stderr. Whenlog.info()fires inside awithProgresscallback — e.g."Applied delta patch"duringsentry cli upgrade— it appends directly after the spinner text on the same line:Fix
Move the spinner from
process.stderrtoprocess.stdout. Since consola writes to stderr and the spinner now writes to stdout, the two streams no longer collide.Also adds
isPlainOutput()suppression to bothwithProgress()andpoll()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, addisPlainOutput()guardtest/commands/issue/utils.test.ts: Update two spinner tests to spy on stdout instead of stderr, setSENTRY_PLAIN_OUTPUT=0to force rich output in non-TTY test env