Skip to content

Auto-update checker silently fails on Windows due to file locking (EBUSY) #103

@Zireael

Description

@Zireael

Describe the bug
The auto-update-checker feature is broken on Windows. It silently fails when trying to remove the active installation directory before reinstalling via npm.

Root Cause
In packages/plugin/src/hooks/auto-update-checker/cache.ts, the removeInstalledPackage function attempts to delete the active plugin directory using rmSync(packageDir, { recursive: true, force: true }).
Because the plugin's code and its native SQLite bindings (.node files) are actively loaded in memory by the process executing the update, Windows strictly locks them. rmSync throws an EBUSY or EPERM error, which is caught by an outer try/catch in preparePackageUpdate(). This causes the updater to log a warning and silently abort.

Expected behavior
The updater should successfully apply updates on Windows. This may require employing an out-of-process updater script or utilizing a workaround like renaming the locked directory (e.g., to .old) before downloading the new package, as Windows sometimes permits renaming open files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions