Plug-ins: a grant one session stops counting stops counting for every session on its folder

The grants that should be gone from grants.json but could not be removed
were kept per Session, so a second Session attached to the same Plug-ins
folder in the same process still counted them for plugin.inspect,
plugin.install and loading plug-ins. They are now kept for the process,
by the folder's canonical path and the plug-in id, and a successful
write of grants.json for the id in any session makes the grant count
again. Attaching another folder no longer clears them.

A failed removal does not override a write another session made for
the id in the meantime. The process keeps the latest 256 grant writes
for that check. Another process on the folder still reads grants.json
as it is written.
This commit is contained in:
dotCooCoo
2026-11-11 17:25:19 -08:00
parent 7f3a046b18
commit 45987bc948
7 changed files with 302 additions and 37 deletions
-1
View File
@@ -87,7 +87,6 @@ impl Session {
color_settings_file: None,
plugin_dir: None,
scripts_dir: None,
ignored_plugin_grants: Default::default(),
plugin_output: None,
plugin_install_approval: None,
plugin_grants_from_requests: false,