Skip to content

Commit

Permalink
don't include sync message in send results
Browse files Browse the repository at this point in the history
  • Loading branch information
boxdot committed Jul 23, 2024
1 parent e8f9f8b commit 67ad530
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions libsignal-service/src/sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use libsignal_protocol::{
ProtocolStore, SenderCertificate, SenderKeyStore, SignalProtocolError,
};
use rand::{CryptoRng, Rng};
use tracing::{info, trace};
use tracing::{error, info, trace};
use tracing_futures::Instrument;

use crate::{
Expand Down Expand Up @@ -191,10 +191,9 @@ where
)
};
if padded_len < len {
tracing::error!(
error!(
"Padded len {} < len {}. Continuing with a privacy risk.",
padded_len,
len
padded_len, len
);
} else {
contents.resize(padded_len, 0);
Expand Down Expand Up @@ -460,8 +459,9 @@ where
timestamp,
&results,
);

let result = self
// Note: the result of sending a sync message is not included in results
// See Signal Android `SignalServiceMessageSender.java:2817`
if let Err(error) = self
.try_send_message(
self.local_aci,
None,
Expand All @@ -470,9 +470,10 @@ where
false, // XXX: maybe the sync device does want a PNI signature?
false,
)
.await;

results.push(result);
.await
{
error!(%error, "failed to send a synchronization message");
}
}

results
Expand Down Expand Up @@ -581,7 +582,7 @@ where
)
.await
.map_err(|e| {
tracing::error!("failed to create session: {}", e);
error!("failed to create session: {}", e);
MessageSenderError::UntrustedIdentity {
address: recipient,
}
Expand Down

0 comments on commit 67ad530

Please sign in to comment.