Skip to content

Conversation

@jablan
Copy link
Collaborator

@jablan jablan commented Jan 13, 2026

Spinner is using a channel to control waiting, batch mode was ignoring this and got stuck in waiting loop.

phrase/phrase-cli#175

@jablan jablan requested a review from Copilot January 13, 2026 11:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a deadlock issue in the CLI's spinner when using push with the -w -B flags (wait mode with batch mode). The spinner was waiting for a channel signal that never came because batch mode was returning early without properly signaling completion.

Changes:

  • Refactored spinner logic to use conditional printing instead of early returns
  • Added new NonBatchPrint function to centralize batch mode handling
  • Replaced direct fmt.Print calls with batch-aware print functions

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
clients/cli/cmd/internal/spinner/spinner.go Removed early return for batch mode and replaced fmt.Print calls with print.NonBatchPrint to ensure channel signaling occurs
clients/cli/cmd/internal/print/print.go Added NonBatchPrint function and optimized NonBatchPrintf to avoid nested formatting

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jablan jablan requested a review from bikmazefe January 13, 2026 11:02
@jablan jablan merged commit 8a1b0f8 into main Jan 13, 2026
12 checks passed
@jablan jablan deleted the fix-wait-in-batch-mode branch January 13, 2026 13:55
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.

3 participants