fix(signal): forward-compat — log+continue on unknown SignalMessage variants
Both sides of the signal channel previously broke their recv loop on any deserialize error, which meant adding a new variant in one build silently killed signal connections from peers running an older build. This bit us during Phase 1 testing: a new client sending SignalMessage::Reflect to a pre-Phase-1 relay caused the relay to drop the whole signal connection, which looked like "Error: not registered" on the next place_call. Fix: - New TransportError::Deserialize(String) variant in wzp-proto carries serde errors as a distinct category. - wzp-transport/reliable.rs::recv_signal returns Deserialize on serde_json::from_slice failures (was wrapped in Internal). - wzp-relay/main.rs signal loop matches on Deserialize → warn + continue (instead of break). - desktop/src-tauri/lib.rs recv loop does the same. Other TransportError variants (ConnectionLost, Io, Internal) still break the loop — only pure parse failures are recoverable. This means future SignalMessage variant additions are backward- compat by construction: older peers will see "unknown variant, continuing" in their logs while newer peers can keep evolving the protocol. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -821,6 +821,15 @@ async fn register_signal(
|
||||
tracing::warn!("signal recv returned None — peer closed");
|
||||
break;
|
||||
}
|
||||
Err(wzp_proto::TransportError::Deserialize(e)) => {
|
||||
// Forward-compat: the relay sent us a
|
||||
// SignalMessage variant we don't know yet
|
||||
// (older client against a newer relay).
|
||||
// Log and keep the signal connection alive —
|
||||
// otherwise direct-call registration would
|
||||
// silently die on any protocol bump.
|
||||
tracing::warn!(error = %e, "signal recv: unknown variant, continuing");
|
||||
}
|
||||
Err(e) => {
|
||||
tracing::warn!(error = %e, "signal recv error — breaking loop");
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user