-
-
Notifications
You must be signed in to change notification settings - Fork 0
Windows rollback calls require inside an ES module and fails silently #38
Copy link
Copy link
Open
Labels
area: coreTouches core library / runtime source codeTouches core library / runtime source codepriority: highNeeds attention soon — not blocking, but don't let it sitNeeds attention soon — not blocking, but don't let it sitstatus: confirmedThe issue has been verified and reproduced by a maintainerThe issue has been verified and reproduced by a maintainertype: bugSomething is broken or not behaving as expectedSomething is broken or not behaving as expected
Description
Activity
Metadata
Metadata
Assignees
Labels
area: coreTouches core library / runtime source codeTouches core library / runtime source codepriority: highNeeds attention soon — not blocking, but don't let it sitNeeds attention soon — not blocking, but don't let it sitstatus: confirmedThe issue has been verified and reproduced by a maintainerThe issue has been verified and reproduced by a maintainertype: bugSomething is broken or not behaving as expectedSomething is broken or not behaving as expected
Problem
The Windows backend's rollback path calls
require(...), but the package is an ES module, sorequireisn't defined there. TheReferenceErroris swallowed, so a failed change on Windows isn't rolled back, and nothing says so.Found while backfilling the changelogs (#36).
Fix
Replace the
requirecall with a staticimport(orcreateRequire(import.meta.url)if a CommonJS module really has to be loaded). Stop swallowing rollback errors: report them, or rethrow alongside the original failure. Add a test that forces the change to fail and asserts the rollback runs, with the Windows backend's registry/process layer mocked so it runs on any OS.