From 2b3fae7778552200b20b6288e6ee2dde73df7c80 Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Sun, 7 Jun 2026 14:03:06 +0200 Subject: [PATCH] feat: handle SSE cache invalidation and nightly rust toolchain config Adds a Vue watch in `ServerDrawer.vue` to trigger a manual container directory refresh when SSE cache invalidation clears `browseData`. Includes guards to prevent redundant requests during active loads and properly manages the `isLoading` state. Additionally, introduces `rust-toolchain.toml` to enforce the nightly Rust compiler across all environments, ensuring consistent builds and access to recent language improvements. --- .../webapp/src/components/unified/ServerDrawer.vue | 14 ++++++++++++++ pmoaudio/src/nodes/flac_file_sink.rs | 2 +- rust-toolchain.toml | 2 ++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 rust-toolchain.toml diff --git a/pmoapp/webapp/src/components/unified/ServerDrawer.vue b/pmoapp/webapp/src/components/unified/ServerDrawer.vue index 0f2783e0..808867e5 100644 --- a/pmoapp/webapp/src/components/unified/ServerDrawer.vue +++ b/pmoapp/webapp/src/components/unified/ServerDrawer.vue @@ -113,6 +113,20 @@ watch(drawerContentRef, (el) => { if (el) setupObserver(); }); +// Recharger quand le cache est invalidé par un événement SSE (containers_updated / global_updated) +watch(browseData, async (data, oldData) => { + if (!data && oldData && currentServer.value && currentContainerId.value && !isLoading.value) { + isLoading.value = true; + try { + await browseContainer(currentServer.value.id, currentContainerId.value, false); + } catch (error) { + console.error("[ServerDrawer] Erreur reload après invalidation cache:", error); + } finally { + isLoading.value = false; + } + } +}); + // État du menu dropdown (pour chaque item, on stocke si son menu est ouvert) const openMenuId = ref(null); diff --git a/pmoaudio/src/nodes/flac_file_sink.rs b/pmoaudio/src/nodes/flac_file_sink.rs index 45e612de..32439fad 100755 --- a/pmoaudio/src/nodes/flac_file_sink.rs +++ b/pmoaudio/src/nodes/flac_file_sink.rs @@ -2,7 +2,7 @@ use crate::{ nodes::{AudioError, TypedAudioNode, DEFAULT_CHANNEL_SIZE}, pipeline::{Node, NodeLogic}, type_constraints::TypeRequirement, - AudioChunk, AudioPipelineNode, AudioSegment, SyncMarker, StreamType, + AudioChunk, AudioPipelineNode, AudioSegment, SyncMarker, }; use pmoflac::{encode_flac_stream, EncoderOptions, PcmFormat}; use std::{ diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 00000000..5d56faf9 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "nightly"