Skip to content

Commit

Permalink
fix(core): Initialize command cache when a capability is added (#11785)
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-berger authored Nov 26, 2024
1 parent f884bae commit ba6f370
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/fix-add-capability-panic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
tauri: 'patch:bug'
---

Fix panic when a plugin command is run with a capability added at runtime (via `Manager::add_capability`).
5 changes: 4 additions & 1 deletion crates/tauri/src/ipc/authority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,10 @@ impl RuntimeAuthority {
.extend(command_scope.allow.clone());
command_scope_entry.deny.extend(command_scope.deny.clone());

self.scope_manager.command_cache.remove(&scope_id);
self
.scope_manager
.command_cache
.insert(scope_id, StateManager::new());
}
}

Expand Down

0 comments on commit ba6f370

Please sign in to comment.