fix: defer uninstall to next restart when DLL is locked on Windows#13
Closed
pabloinigoblasco wants to merge 2 commits into
Closed
fix: defer uninstall to next restart when DLL is locked on Windows#13pabloinigoblasco wants to merge 2 commits into
pabloinigoblasco wants to merge 2 commits into
Conversation
On Windows, uninstalling a plugin while it is loaded by the host process causes QDir::removeRecursively() to fail silently. This change aligns the uninstall flow with the existing install staging pattern: - ExtensionManager: new signal `uninstallPendingRestart`, new public method `applyPendingUninstalls()`, private helper `schedulePendingUninstall()` - MarketplaceWindow: subscribes to `uninstallPendingRestart` and shows the appropriate "restart required" feedback to the user When removeRecursively() fails on Windows, uninstall() now: 1. Writes a `.pj_pending_uninstall` marker inside the extension directory 2. Removes the extension from the in-memory registry immediately 3. Emits the new `uninstallPendingRestart(id)` signal instead of an error At the next application startup, `applyPendingUninstalls()` scans extensions_dir for directories carrying the marker and deletes them.
86a0a5b to
7fc7657
Compare
6 tasks
Collaborator
Author
|
Superseded by #22, which is a unified reconstruction of the Windows marketplace adaptation work (staging for install/update/uninstall when DLLs are locked). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ExtensionManager: new signaluninstallPendingRestart, new public methodapplyPendingUninstalls(), private helperschedulePendingUninstall()MarketplaceWindow: subscribes touninstallPendingRestartand shows the appropriate "restart required" feedback to the userProblem
On Windows, uninstalling a plugin while it is loaded by the host process causes
QDir::removeRecursively()to fail silently: the extension was not removed from disk, but the error was reported and the operation stopped there, leaving the user with no actionable path forward.Solution
Align the uninstall flow with the existing install staging pattern. When
removeRecursively()fails on Windows,uninstall()now:.pj_pending_uninstallmarker inside the extension directoryuninstallPendingRestart(id)signal instead of an errorAt the next application startup,
applyPendingUninstalls()scansextensions_dirfor directories carrying the marker and deletes them. If the directory still cannot be removed (unusual), it is silently skipped and retried on the following startup.Test plan
./build.sh --debug && ./test.sh— all tests passApplyPendingUninstallsRemovesMarkedDirectory,ApplyPendingUninstallsIgnoresUnmarkedDirectory,ApplyPendingUninstallsIsNoOpForEmptyDirectory