GeezerVison is showing github.com — Fix migration wipe of revert wiring in pnpm vendor · SocketDev/socket-patch@d243919
File tree
Expand file treeCollapse file tree
Open diff view settings
crates/socket-patch-core/src/vendor
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: crates/socket-patch-core/src/vendor/pnpm_lock.rs +8-5Lines changed: 8 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -271,11 +271,14 @@ pub async fn vendor_pnpm( |
271 | 271 | Err(e) => return done_failure(purl, format!("{PNPM_WORKSPACE} surgery failed: {e}")), |
272 | 272 | }; |
273 | 273 |
|
274 | | - if !pkg_changed && !lock_changed && ws_edit.new_text.is_none() { |
275 | | - // Everything already carries this uuid + the packed integrity: the |
276 | | - // project is in sync. The tarball re-pack above was byte-identical |
277 | | - // by determinism; synthesize AlreadyPatched and record nothing (the |
278 | | - // existing ledger entry stays authoritative). |
| 274 | + if !pkg_changed && !lock_changed { |
| 275 | + // package.json and the lock already carry this uuid + the packed |
| 276 | + // integrity: the core wiring is in sync. The tarball re-pack above was |
| 277 | + // byte-identical by determinism. Even if the workspace file (pnpm >= 11 |
| 278 | + // surface) needs first-time creation during migration, that must not |
| 279 | + // replace the ledger entry and wipe package.json/lock revert wiring. |
| 280 | + // Synthesize AlreadyPatched and record nothing (the existing ledger |
| 281 | + // entry stays authoritative). |
279 | 282 | return done( |
280 | 283 | already_patched_result(purl, &project_root.join(&rel_tgz), &record.files), |
281 | 284 | None, |
|