refactor: align bridge state resolver metadata

This commit is contained in:
Edison Jwa
2026-06-08 20:20:18 +09:00
parent 8c4f85ee70
commit 57a4d9767b
4 changed files with 75 additions and 34 deletions
+2 -11
View File
@@ -346,9 +346,7 @@ pub fn reduce(state: &mut Option<ServerState>, event: StateEvent) -> Reduction {
if removed_channel {
deltas.push(Delta::ChannelRemoved(id));
}
Reduction {
deltas,
}
Reduction { deltas }
}
_ => Reduction { deltas: vec![] },
},
@@ -412,14 +410,7 @@ pub fn reduce_reconnect_snapshot(
state: &mut Option<ServerState>,
snap: ServerSnapshot,
) -> Reduction {
let normalized = normalize_snapshot(snap);
*state = Some(ServerState::from_snapshot(normalized.clone()));
Reduction {
deltas: vec![
Delta::ConnectionStateChanged(ConnectionState::Ready),
Delta::SnapshotApplied(normalized),
],
}
reduce(state, StateEvent::Snapshot(snap))
}
#[cfg(test)]