Skip to content

Commit

Permalink
chore: handle game version configs with bad proto migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanFlurry committed Jun 18, 2024
1 parent d6d05f6 commit 9df1f7b
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions svc/pkg/mm-config/ops/version-get/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,21 +191,31 @@ async fn fetch_versions(

let runtime =
backend::matchmaker::LobbyRuntime::decode(lg.runtime.as_ref())?;
let find_config = lg
let (find_config, join_config, create_config) = match(
lg
.find_config
.as_ref()
.map(|fc| backend::matchmaker::FindConfig::decode(fc.as_ref()))
.transpose()?;
let join_config = lg
.transpose(),
lg
.join_config
.as_ref()
.map(|jc| backend::matchmaker::JoinConfig::decode(jc.as_ref()))
.transpose()?;
let create_config = lg
.transpose(),
lg
.create_config
.as_ref()
.map(|jc| backend::matchmaker::CreateConfig::decode(jc.as_ref()))
.transpose()?;
.transpose()
) {
(Ok(a), Ok(b), Ok(c)) => {
(a, b, c)
}
(Err(err), _, _) | (_, Err(err), _) |(_, _, Err(err)) => {
tracing::warn!(?err, "failed to decode actions, this is a bad proto migration");
None
}
}

Ok(backend::matchmaker::LobbyGroup {
name_id: lg.name_id.clone(),
Expand Down

0 comments on commit 9df1f7b

Please sign in to comment.