Plug-ins: removing an installed plug-in whose module can't be deleted fails

plugin.remove now deletes an installed plug-in's stored module along with
its grant, before its settings and cache are deleted. When the module file
can't be deleted, the command returns "can't delete <file>", the settings
and cache are moved back, the plug-in stays installed, and the grant the
signed grants file held for it is written back, so the stored module
still loads at the next launch. Before, the command returned {removed}
and left the module in the plug-in folder.
This commit is contained in:
dotCooCoo committed 2026-11-25 04:23:08 -08:00
1 parent ee947082ed
commit 232c17b25a
5 files changed
+68 -6

No files matched your search

+2 -1
View File
@@ -286,7 +286,8 @@ capability model proposed for PhotoCraft plug-ins
hexadecimal digits covers nothing. `plugin.remove` forgets the grant, and so does a successful `plugin.install` of a
module that lists no permissions under that id, so the earlier bytes need a new approval. When `plugin.remove` can't
remove the grant from `grants.json`, it returns an error, the plug-in stays installed, and a second `plugin.remove`
tries again. A refused install leaves the grant, the plug-in installed with the id, the `Plug-ins` folder and the
tries again. The same happens when it can't delete the plug-in's stored module, and the grant stays in `grants.json`.
A refused install leaves the grant, the plug-in installed with the id, the `Plug-ins` folder and the
list of disabled plug-ins as they are. When another session installs a plug-in with the id or changes its grant
while `plugin.install` checks a module, the install is refused, before anything is written to the `Plug-ins` folder,
if the other plug-in would need `replace: true` or the changed grant no longer approves the module. A