Skip to content

fix: address review comments from Bun→Node migration PRs#989

Merged
BYK merged 2 commits into
mainfrom
fix/review-followups
May 20, 2026
Merged

fix: address review comments from Bun→Node migration PRs#989
BYK merged 2 commits into
mainfrom
fix/review-followups

Conversation

@BYK
Copy link
Copy Markdown
Member

@BYK BYK commented May 20, 2026

Summary

Consolidates fixes for review comments across PRs #967, #970, #984, #986, superseding #988.

Critical

  • Bump engines.node to >=22.15node:zlib zstd APIs require 22.15+. Node 20 is EOL. Updated dist/bin.cjs runtime version check to match.
  • Simplify zstd imports — replaced feature-detection dance with direct import { zstdCompress } from "node:zlib" now that >=22.15 is guaranteed.

High

  • Fix spawn error handling in upgrade.tsproc.on("error", () => resolve(1)) discarded the error object, making ENOENT/EBUSY detection dead code. Now properly rejects with the error.

Medium

  • Fix sqlite.ts ROLLBACK — if ROLLBACK throws, the original transaction error was lost. Now wrapped in try/catch.
  • Guard semver.compare in delta-upgrade.ts with semver.valid() to avoid throwing on invalid version strings.
  • Narrow catch in shell.ts addToGitHubPath — only catch ENOENT, re-throw EACCES/EPERM.
  • Add WriteStream backpressure in upgrade.ts streamDecompressToFile — check write() return value, await 'drain'.
  • Add setup-node@v6 with Node 22 to E2E CI job.

Low

  • Fix whichSync Windows CRLF — split on /\r?\n/ instead of \n to strip trailing \r from where.exe output.

Test results

All 7014 tests pass, 0 failures.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/_preview/pr-989/

Built to branch gh-pages at 2026-05-20 17:58 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

Codecov Results 📊

7014 passed | Total: 7014 | 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 61.29%. Project has 14233 uncovered lines.
✅ Project coverage is 77.11%. Comparing base (base) to head (head).

Files with missing lines (4)
File Patch % Lines
src/lib/upgrade.ts 16.67% ⚠️ 15 Missing
src/lib/db/sqlite.ts 0.00% ⚠️ 5 Missing
src/lib/delta-upgrade.ts 75.00% ⚠️ 2 Missing
src/lib/shell.ts 80.00% ⚠️ 2 Missing
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    77.10%    77.11%    +0.01%
==========================================
  Files          322       322         —
  Lines        62163     62169        +6
  Branches         0         0         —
==========================================
+ Hits         47923     47936       +13
- Misses       14240     14233        -7
- Partials         0         0         —

Generated by Codecov Action

Comment thread src/lib/upgrade.ts
Comment thread src/lib/shell.ts
Comment thread src/lib/upgrade.ts Outdated
@BYK BYK force-pushed the fix/review-followups branch from 02dd451 to 65df489 Compare May 20, 2026 17:43
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit fe0fae4. Configure here.

Comment thread src/lib/upgrade.ts
Comment thread src/lib/shell.ts
Comment thread src/lib/upgrade.ts
@BYK BYK force-pushed the fix/review-followups branch from fe0fae4 to d8121f8 Compare May 20, 2026 17:49
Consolidates fixes for review comments across PRs #967, #970, #984, #986.

Changes:
- Bump engines.node from >=22.12 to >=22.15 (zstd APIs require 22.15+,
  Node 20 is EOL). Update dist/bin.cjs runtime version check to match.
- Simplify zstd imports: replace feature-detection dance with direct
  imports from node:zlib now that >=22.15 is guaranteed.
- Fix spawn error handling in upgrade.ts: propagate error object to catch
  block so ENOENT/EBUSY detection works (was silently resolving with 1).
- Fix sqlite.ts transaction(): wrap ROLLBACK in try/catch so original
  error is preserved if ROLLBACK itself fails.
- Guard semver.compare calls in delta-upgrade.ts with semver.valid() to
  avoid throwing on invalid version strings.
- Narrow catch in shell.ts addToGitHubPath to ENOENT only, re-throw
  other errors (EACCES, EPERM) instead of silently swallowing.
- Add WriteStream backpressure handling in upgrade.ts
  streamDecompressToFile: check write() return value, await drain.
- Add setup-node@v6 with Node 22 to E2E CI job.
- Fix whichSync Windows CRLF: split on /\r?\n/ instead of \n.

7014 tests pass, 0 failures.
@BYK BYK force-pushed the fix/review-followups branch from c089b7c to 4e3a79f Compare May 20, 2026 17:56
@BYK BYK merged commit 2e4435e into main May 20, 2026
30 checks passed
@BYK BYK deleted the fix/review-followups branch May 20, 2026 18:06
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