Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp

fix(svc): gate the in-memory transport behind a feature (#3606)

strangeglyph52b1c2fbd332
diff --git a/fluxer_messages/Cargo.toml b/fluxer_messages/Cargo.toml
index f1178fc2c..9d13369a5 100644
--- a/fluxer_messages/Cargo.toml
+++ b/fluxer_messages/Cargo.toml
@@ -23,6 +23,9 @@ tokio = { version = "1.53.1", features = ["macros", "rt-multi-thread", "signal"]
tracing = "0.1.44"
url = "2.5.8"
+[dev-dependencies]
+fluxer-svc = { path = "../fluxer_svc", features = ["mock"] }
+
[features]
default = []
scylla = ["dep:scylla", "fluxer-svc/scylla"]
diff --git a/fluxer_svc/Cargo.toml b/fluxer_svc/Cargo.toml
index 1f953ec7e..14a8de13e 100644
--- a/fluxer_svc/Cargo.toml
+++ b/fluxer_svc/Cargo.toml
@@ -28,3 +28,4 @@ tracing-subscriber = { version = "0.3.23", features = ["env-filter", "fmt", "jso
[features]
default = []
scylla = ["dep:scylla"]
+mock = []
diff --git a/fluxer_svc/src/transport.rs b/fluxer_svc/src/transport.rs
index 0dae7058f..978619766 100644
--- a/fluxer_svc/src/transport.rs
+++ b/fluxer_svc/src/transport.rs
@@ -308,7 +308,7 @@ impl NatsMessage {
}
}
-#[cfg(debug_assertions)]
+#[cfg(any(test, feature = "mock"))]
mod in_memory {
use super::{NoResponders, Transport, TransportMessage, TransportSubscriber};
use async_trait::async_trait;
@@ -518,5 +518,5 @@ mod in_memory {
}
}
-#[cfg(debug_assertions)]
+#[cfg(any(test, feature = "mock"))]
pub use in_memory::InMemoryTransport;