From fb7d1da03646ce48a1cabb2e768cf4158fc0cafb Mon Sep 17 00:00:00 2001 From: Christian Friedow Date: Tue, 18 Jul 2023 21:40:26 +0200 Subject: [PATCH] fix: clear should not remove data from other plugins --- service/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/service/src/lib.rs b/service/src/lib.rs index d151ba7..0e94736 100644 --- a/service/src/lib.rs +++ b/service/src/lib.rs @@ -206,7 +206,7 @@ impl + Unpin> Service { Event::Response((plugin, response)) => match response { PluginResponse::Append(item) => self.append(plugin, item), - PluginResponse::Clear => self.clear(), + PluginResponse::Clear => self.clear(plugin), PluginResponse::Close => self.close().await, PluginResponse::Context { id, options } => { self.context_response(id, options).await; @@ -324,8 +324,8 @@ impl + Unpin> Service { self.active_search.push((plugin, append)); } - fn clear(&mut self) { - self.active_search.clear(); + fn clear(&mut self, plugin: PluginKey) { + self.active_search.retain(|item| item.0 != plugin); } async fn close(&mut self) {