Skip to content

fix(cli): warn when PowerShell mangles piped dumps - #6418

Merged
7ttp merged 7 commits into
developfrom
7ttp/cli-2277-warn-when-powershell-mangles-piped-output
Sep 2, 2026
Merged

fix(cli): warn when PowerShell mangles piped dumps#6418
7ttp merged 7 commits into
developfrom
7ttp/cli-2277-warn-when-powershell-mangles-piped-output

Conversation

@7ttp

@7ttp 7ttp commented Sep 1, 2026

Copy link
Copy Markdown
Member

TL;DR

Windows PowerShell 5.1 re-encodes piped native stdout and corrupts multi-byte UTF-8 in db dump output
so: added one stderr warning pointing at --file, only when a piped Windows dump actually contains non-ASCII bytes...

ref

@7ttp 7ttp self-assigned this Sep 1, 2026
@7ttp
7ttp requested a review from a team as a code owner September 1, 2026 09:47

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 587ce19105

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread apps/cli/src/legacy/commands/db/dump/dump.handler.ts Outdated
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Supabase CLI preview

npx --yes https://pkg.pr.new/supabase/cli/supabase@d8fecc763755d6db3342a0a6605fe29e9e1aa293

Preview package for commit d8fecc7.

@7ttp

7ttp commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

/ai-review

@github-actions github-actions Bot 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.

Superseded by a newer AI review

🤖 AI Review

Seven reported findings deduplicate to six. All are confirmed: the main concern is that the Windows shell heuristic is both over- and under-inclusive; the remaining items are a production-layer test gap and four nits. No critical or major issue was found.

Findings

Severity Location Category Sources Claim
🟡 MINOR apps/cli/src/legacy/commands/db/dump/dump.handler.ts:276 correctness claude+codex The pipe heuristic cannot identify the redirecting shell: it warns for byte-faithful Windows pipes and suppresses warnings when MSYS/mintty variables are inherited by a PowerShell child.
🟡 MINOR apps/cli/src/shared/runtime/tty.layer.ts:11 test-coverage claude The production stdout pipe-detection primitive is untested, while command tests replace it with a mocked stdoutIsPipe value.
⚪ NIT apps/cli/src/legacy/commands/db/dump/dump.handler.ts:279 correctness claude An explicitly empty MSYSTEM environment variable suppresses the warning as though an MSYS session had been detected.
⚪ NIT apps/cli/src/legacy/commands/db/dump/dump.handler.ts:338 readability claude The non-ASCII scan communicates its latched state indirectly by assigning on every iteration and relying on the loop condition to preserve a true result.
⚪ NIT apps/cli/src/shared/runtime/tty.service.ts:6 documentation claude The stdoutIsPipe documentation is broader than its FIFO-only implementation and does not disclose that socket-backed stdout channels return false.
⚪ NIT apps/cli/src/legacy/commands/db/dump/dump.handler.ts:276 code-quality claude The handler computes the pipe/env tracking gate for --file dumps even though that branch never scans stdout, and the tests do not explicitly pin silence for that combination.

Stats

Claude findings: 6 · Codex findings: 1 · Confirmed: 6 · Refuted: 0 · Uncertain: 0


Models: claude-opus-5 + gpt-5.6-sol · Trigger: manual · Workflow run

This review runs once per PR. A maintainer can request another with a /ai-review comment.

Comment thread apps/cli/src/legacy/commands/db/dump/dump.handler.ts
Comment thread apps/cli/src/shared/runtime/tty.layer.ts
Comment thread apps/cli/src/legacy/commands/db/dump/dump.handler.ts Outdated
Comment thread apps/cli/src/legacy/commands/db/dump/dump.handler.ts
Comment thread apps/cli/src/shared/runtime/tty.service.ts Outdated
Comment thread apps/cli/src/legacy/commands/db/dump/dump.handler.ts
@7ttp
7ttp added this pull request to the merge queue Sep 2, 2026
Merged via the queue into develop with commit 430d5ed Sep 2, 2026
74 checks passed
@7ttp
7ttp deleted the 7ttp/cli-2277-warn-when-powershell-mangles-piped-output branch September 2, 2026 09:49
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.

DB Dump Corrupting Unicode Characters

2 participants