fix(mesh): enforce LoRa-only off-grid labels
This commit is contained in:
@@ -1116,7 +1116,14 @@ impl MeshService {
|
||||
.map(|p| !p.reachable && p.arch_pubkey_hex.is_some())
|
||||
.unwrap_or(false)
|
||||
};
|
||||
if is_federation_synthetic || exceeds_lora || radio_federated_unreachable {
|
||||
let mesh_only_mode = load_config(&self.data_dir)
|
||||
.await
|
||||
.ok()
|
||||
.and_then(|cfg| cfg.mesh_only_mode)
|
||||
.unwrap_or(false);
|
||||
if !mesh_only_mode
|
||||
&& (is_federation_synthetic || exceeds_lora || radio_federated_unreachable)
|
||||
{
|
||||
// Resolve the peer's pubkey/did. Prefer the live mesh peer table,
|
||||
// but fall back to federation storage for federation-synthetic ids
|
||||
// that were never seeded into `state.peers` — e.g. a radio-less
|
||||
@@ -1185,6 +1192,17 @@ impl MeshService {
|
||||
// (`send_dm_via_channel` in listener/session.rs) handles both
|
||||
// single-frame and chunked transmission internally; we must NOT
|
||||
// pre-chunk here as well or the receiver sees garbage.
|
||||
} else if mesh_only_mode
|
||||
&& (is_federation_synthetic || exceeds_lora || radio_federated_unreachable)
|
||||
{
|
||||
tracing::info!(
|
||||
contact_id,
|
||||
bytes = wire.len(),
|
||||
is_federation_synthetic,
|
||||
exceeds_lora,
|
||||
radio_federated_unreachable,
|
||||
"Off-grid mode active; forcing mesh message over LoRa only"
|
||||
);
|
||||
}
|
||||
self.send_raw_payload(contact_id, wire).await?;
|
||||
Ok(self
|
||||
|
||||
Reference in New Issue
Block a user