Skip to content

Windows rollback calls require inside an ES module and fails silently #38

Description

@Shinrai

Problem

The Windows backend's rollback path calls require(...), but the package is an ES module, so require isn't defined there. The ReferenceError is swallowed, so a failed change on Windows isn't rolled back, and nothing says so.

Found while backfilling the changelogs (#36).

Fix

Replace the require call with a static import (or createRequire(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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: coreTouches core library / runtime source codepriority: highNeeds attention soon — not blocking, but don't let it sitstatus: confirmedThe issue has been verified and reproduced by a maintainertype: bugSomething is broken or not behaving as expected

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions