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

+3 -1
View File
@@ -13469,7 +13469,9 @@ need a new approval. A refused install keeps the grant. A failed write of the mo
grant in the store. A stored module that is disabled, or not read in Safe Mode, keeps the grant for its id. When
`plugin.remove` can't remove the grant from the plug-in store, it returns an error and the plug-in stays installed;
so does a `plugin.remove` while the system key store can't be reached, also when `grants.json` is missing or doesn't
name the plug-in. For an id that isn't installed, `plugin.remove` also deletes the module stored for it that didn't
name the plug-in. When `plugin.remove` can't delete an installed plug-in's stored module, it returns an error naming
the file, and the plug-in stays installed with its grant kept in the store. For an id that isn't installed,
`plugin.remove` also deletes the module stored for it that didn't
load and returns `{removed}`. When the plug-in's settings and cache can't be moved back from their `.removed` folder
then either, the error names that folder, and the next load, install or `plugin.remove` of the plug-in moves them back. A
filter without `doc.write` or `state` that returns output needing them gets an error and the document is unchanged.
+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