fix(plugin): skip non-V4 notifications

This commit is contained in:
Hakan Seven 2026-08-18 18:46:19 +03:00
commit c62bbe59a9
2 changed files with 14 additions and 0 deletions

View file

@ -675,6 +675,11 @@ impl PluginProcess {
}
}
/// Whether this plugin process speaks the V4 protocol.
pub fn is_v4(&self) -> bool {
self.v4.is_some()
}
/// Send a best-effort host-to-plugin notification. Requires V4; on V3
/// processes this returns an error.
pub fn notify_plugin(

View file

@ -91,6 +91,15 @@ impl PluginManager {
if !p.process.is_alive() {
continue;
}
if !p.process.is_v4() {
if crate::process::verbose() {
eprintln!(
"[plugin] skipping notification for {} (not V4)",
p.process.id()
);
}
continue;
}
if let Err(e) = p.process.notify_plugin(command_id, notification.clone()) {
eprintln!(
"[plugin] broadcast_notification failed for {}: {e}",