Skip to content

Commit ba6f370

Browse files
authored
fix(core): Initialize command cache when a capability is added (#11785)
1 parent f884bae commit ba6f370

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.changes/fix-add-capability-panic.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
tauri: 'patch:bug'
3+
---
4+
5+
Fix panic when a plugin command is run with a capability added at runtime (via `Manager::add_capability`).

crates/tauri/src/ipc/authority.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,10 @@ impl RuntimeAuthority {
322322
.extend(command_scope.allow.clone());
323323
command_scope_entry.deny.extend(command_scope.deny.clone());
324324

325-
self.scope_manager.command_cache.remove(&scope_id);
325+
self
326+
.scope_manager
327+
.command_cache
328+
.insert(scope_id, StateManager::new());
326329
}
327330
}
328331

0 commit comments

Comments
 (0)