Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: invalid warning about sync claim #261

Merged
merged 2 commits into from
Nov 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions libsignal-service/src/sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,25 +380,26 @@ where
results.push(result);
}

if needs_sync_in_results != message.is_some() {
if needs_sync_in_results && message.is_none() {
// XXX: does this happen?
log::warn!("Server claims need sync, but not sending datamessage.");
}

// we only need to send a synchronization message once
if let Some(message) = message {
let sub_device_count = match self
let is_multi_device = self
.protocol_store
.get_sub_device_sessions(&self.local_address)
.await
{
Ok(x) => x.len(),
Err(e) => {
log::error!("Attempt to count local subdevices failed; assuming zero: {}", e);
0
},
};
if needs_sync_in_results || sub_device_count > 0 {
.map(|sessions| !sessions.is_empty())
.unwrap_or_else(|e| {
log::error!(
"Attempt to count local subdevices failed; \
assuming zero: {e}"
);
false
});
if needs_sync_in_results || is_multi_device {
let sync_message = self
.create_multi_device_sent_transcript_content(
None,
Expand Down
Loading