Skip to content

Commit

Permalink
fix: do not ignore peerstate.save_to_db() errors
Browse files Browse the repository at this point in the history
  • Loading branch information
link2xt committed Dec 18, 2023
1 parent 9b1704e commit 78affb7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/securejoin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ pub(crate) async fn observe_securejoin_on_other_device(
};
peerstate.set_verified(PeerstateKeyType::GossipKey, fingerprint, addr)?;
peerstate.prefer_encrypt = EncryptPreference::Mutual;
peerstate.save_to_db(&context.sql).await.unwrap_or_default();
peerstate.save_to_db(&context.sql).await?;

ChatId::set_protection_for_contact(
context,
Expand Down Expand Up @@ -738,7 +738,7 @@ async fn mark_peer_as_verified(
};
peerstate.set_verified(PeerstateKeyType::PublicKey, fingerprint, verifier)?;
peerstate.prefer_encrypt = EncryptPreference::Mutual;
peerstate.save_to_db(&context.sql).await.unwrap_or_default();
peerstate.save_to_db(&context.sql).await?;
Ok(true)
}

Expand Down

0 comments on commit 78affb7

Please sign in to comment.