Skip to content

fix(build): address PR review feedback#1142

Closed
jdalton wants to merge 1 commit intochore/build-rename-configsfrom
fix/build-pr-feedback
Closed

fix(build): address PR review feedback#1142
jdalton wants to merge 1 commit intochore/build-rename-configsfrom
fix/build-pr-feedback

Conversation

@jdalton
Copy link
Copy Markdown
Contributor

@jdalton jdalton commented Apr 1, 2026

Summary

Follow-up fixes after review of chore/build-rename-configs:

  • runBuild() now rethrows after catching so Promise.allSettled can detect rejections
  • download-assets: handle rejected promises from allSettled, not just ok: false
  • esbuild.cli.mjs: fix plugin order so envVarReplacement runs after unicode transform
  • build.mjs: fix watch mode error message to use fallback exit code 1
  • package.json: fix e2e:sea indentation

Test plan

  • pnpm run build succeeds
  • Download failures surface correctly in error output

Note

Medium Risk
Touches CLI build tooling and asset download flow; incorrect error handling or plugin order could cause builds to succeed incorrectly or fail unexpectedly in CI.

Overview
Fixes several Socket CLI build reliability issues.

Reorders the esbuild plugins in esbuild.cli.mjs so unicodeTransformPlugin() runs before envVarReplacementPlugin() as intended. Tightens failure handling by rethrowing errors from runBuild() (so Promise.allSettled can observe rejections), improving download-assets reporting/exit codes for rejected downloads, and ensuring watch-mode errors include a ?? 1 fallback exit code. Also normalizes the e2e:sea script entry in package.json.

Written by Cursor Bugbot for commit 16a85cf. Configure here.

- runBuild() rethrows after catching so Promise.allSettled can detect rejections
- download-assets: handle rejected promises in allSettled, not just ok:false
- esbuild.cli.mjs: fix plugin order so envVarReplacement runs after unicode transform
- build.mjs: fix watch mode error message to use fallback exit code 1
- package.json: fix e2e:sea indentation
Copy link
Copy Markdown

@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 ON. A cloud agent has been kicked off to fix the reported issue.

Comment @cursor review or bugbot run to trigger another review on this PR

logger.error(`Build failed: ${description || 'Unknown'}`)
logger.error(e)
process.exitCode = 1
throw e
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Rethrown error causes unhandled rejection in standalone callers

Medium Severity

Adding throw e in runBuild's catch block enables Promise.allSettled detection in esbuild.build.mjs, which properly handles rejections. However, esbuild.cli.mjs (line 203) and esbuild.index.mjs (line 23) call runBuild() without a .catch() handler. On build failure, this now produces an unhandled promise rejection in those standalone scripts, resulting in duplicate error output and a noisy Node.js crash trace. The esbuild.cli.mjs script is specifically spawned as a child process during watch mode.

Additional Locations (1)
Fix in Cursor Fix in Web

@jdalton
Copy link
Copy Markdown
Contributor Author

jdalton commented Apr 1, 2026

Superseded by #1140 which already includes these changes.

@jdalton jdalton closed this Apr 1, 2026
@jdalton jdalton deleted the fix/build-pr-feedback branch April 2, 2026 03:44
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