Skip to content

Patch command bugs#1104

Closed
mikolalysenko wants to merge 3 commits intofeat/socket-patch-v2from
cursor/patch-command-bugs-ef10
Closed

Patch command bugs#1104
mikolalysenko wants to merge 3 commits intofeat/socket-patch-v2from
cursor/patch-command-bugs-ef10

Conversation

@mikolalysenko
Copy link
Contributor

@mikolalysenko mikolalysenko commented Mar 6, 2026

Fix signal propagation in cmd-patch and sanitize environment-specific values in CLI test snapshots.

The cmd-patch command now correctly propagates signals from its child process, preventing silent exits when the child is killed by a signal. Test snapshots were updated to use <redacted> placeholders for paths, versions, and token info, and a normalizeBanner utility was added to ensure consistent test results across different environments.


Note

Medium Risk
Switches socket patch execution from a Node wrapper to a spawned platform-specific binary and changes how env/exit/signal handling works, which can affect behavior across OSes. Dependency and lockfile updates add multiple optional native packages that may introduce install/runtime edge cases.

Overview
Updates the CLI to v1.1.58 and upgrades @socketsecurity/socket-patch to 2.0.0, pulling in platform-specific optional native binaries via the lockfile.

Refactors socket patch to resolve and spawnSync the socket-patch bin directly, mapping Socket CLI env vars to the binary’s expected env vars and propagating child exit codes/signals.

Expands README.md with a socket patch subcommand reference + quick-start, and stabilizes CLI test snapshots by redacting banner/version/token/cwd values via a new normalizeBanner helper.

Written by Cursor Bugbot for commit cbe0b68. This will update automatically on new commits. Configure here.

mikolalysenko and others added 3 commits January 10, 2026 20:32
Update socket-patch dependency from v1.0.0 to v1.2.0, which includes:
- Progress spinner for scan command
- Improved test coverage

This update addresses reviewer feedback in depscan PR #16387 regarding
the socket-patch version mismatch.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Upgrade socket-patch from v1.2.0 to v2.0.0, now a native Rust binary
- Rewrite patch command to spawn the platform-specific Rust binary
  directly instead of importing the Node.js runPatch() function
- Map socket-cli environment variables to socket-patch env vars
  (SOCKET_API_URL, SOCKET_API_TOKEN, SOCKET_ORG_SLUG, etc.)
- Add comprehensive patch command documentation to README with
  subcommand reference table and quick-start guide
- Bump version to 1.1.58
- Add signal handling to cmd-patch.mts to properly propagate signals when child process is killed
- Fix test snapshots to use <redacted> placeholders for machine-specific values (CLI version, token, org, cwd)
- Add normalizeBanner() function to test utils to sanitize Socket CLI banner output
- Include 'Received an unknown command: patch' line in cli.test.mts snapshot as it appears during test execution
@mikolalysenko mikolalysenko force-pushed the feat/socket-patch-v2 branch from 48d3c65 to 9c21ec1 Compare March 6, 2026 19:20
@mikolalysenko
Copy link
Contributor Author

Closing — these fixes are already included in #1103 (moved socket-patch to dependencies, added shell: constants.WIN32 for Windows, signal propagation, and restored test snapshots).

@cursor cursor bot deleted the cursor/patch-command-bugs-ef10 branch March 6, 2026 20: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.

2 participants