diff --git a/Cargo.lock b/Cargo.lock index 7ea618227..2126b97d4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6411,7 +6411,7 @@ dependencies = [ [[package]] name = "rspc" version = "0.1.4" -source = "git+https://github.com/oscartbeaumont/rspc?rev=745f0b210f6d268a4cef5d43b595e88d99ac269f#745f0b210f6d268a4cef5d43b595e88d99ac269f" +source = "git+https://github.com/oscartbeaumont/rspc?rev=e40eb883c69c315d67c8a0ed7e4a010cd26c5b6a#e40eb883c69c315d67c8a0ed7e4a010cd26c5b6a" dependencies = [ "futures", "futures-channel", diff --git a/Cargo.toml b/Cargo.toml index b6a59773a..daf7b6d4a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,5 +45,5 @@ if-watch = { git = "https://github.com/oscartbeaumont/if-watch", rev = "410e8e1d mdns-sd = { git = "https://github.com/oscartbeaumont/mdns-sd", rev = "45515a98e9e408c102871abaa5a9bff3bee0cbe8" } # TODO: Do upstream PR -rspc = { git = "https://github.com/oscartbeaumont/rspc", rev = "745f0b210f6d268a4cef5d43b595e88d99ac269f" } +rspc = { git = "https://github.com/oscartbeaumont/rspc", rev = "e40eb883c69c315d67c8a0ed7e4a010cd26c5b6a" } httpz = { git = "https://github.com/oscartbeaumont/httpz", rev = "a5185f2ed2fdefeb2f582dce38a692a1bf76d1d6" } diff --git a/core/src/api/utils/invalidate.rs b/core/src/api/utils/invalidate.rs index 30b709c7a..b034b45b3 100644 --- a/core/src/api/utils/invalidate.rs +++ b/core/src/api/utils/invalidate.rs @@ -249,16 +249,17 @@ pub(crate) fn mount_invalidate() -> AlphaRouter { // Given human reaction time of ~250 milli this should be a good ballance. _ = tokio::time::sleep(Duration::from_millis(200)) => { let x = buf.drain().map(|(_k, v)| v).collect::>(); - match tx.send(x) { - Ok(_) => {}, - // All receivers are shutdown means that all clients are disconnected. - Err(_) => { - debug!("Shutting down invalidation manager! This is normal if all clients disconnects."); - manager_thread_active.swap(false, Ordering::Relaxed); - break; + if x.len() > 0 { + match tx.send(x) { + Ok(_) => {}, + // All receivers are shutdown means that all clients are disconnected. + Err(_) => { + debug!("Shutting down invalidation manager! This is normal if all clients disconnects."); + manager_thread_active.swap(false, Ordering::Relaxed); + break; + } } } - } } } diff --git a/core/src/api/utils/library.rs b/core/src/api/utils/library.rs index a580bc5b9..a8f570ffe 100644 --- a/core/src/api/utils/library.rs +++ b/core/src/api/utils/library.rs @@ -13,7 +13,10 @@ use crate::{api::Ctx, library::Library}; /// Can wrap a query argument to require it to contain a `library_id` and provide helpers for working with libraries. #[derive(Clone, Serialize, Deserialize, Type)] -pub(crate) struct LibraryArgs(pub Uuid, pub T); +pub(crate) struct LibraryArgs { + library_id: Uuid, + arg: T, +} pub(crate) struct LibraryArgsLike; impl MwArgMapper for LibraryArgsLike { @@ -23,7 +26,7 @@ impl MwArgMapper for LibraryArgsLike { fn map( arg: Self::Input, ) -> (T, Self::State) { - (arg.1, arg.0) + (arg.arg, arg.library_id) } }