Skip to content

Commit

Permalink
Workaround UUID not found errors
Browse files Browse the repository at this point in the history
This just ignores those errors when sending to a group.

Ideally, this should mark such contacts as unregistered and not send
messages to them anymore. But the store does not yet have the capability
to do that.

Related to whisperfish#110.
  • Loading branch information
Schmiddiii committed Mar 17, 2024
1 parent 97e2357 commit 44ef9df
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions presage/src/manager/registered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use libsignal_service::groups_v2::{decrypt_group, Group, GroupsManager, InMemory
use libsignal_service::messagepipe::{Incoming, MessagePipe, ServiceCredentials};
use libsignal_service::models::Contact;
use libsignal_service::prelude::phonenumber::PhoneNumber;
use libsignal_service::prelude::{ProtobufMessage, Uuid};
use libsignal_service::prelude::{MessageSenderError, ProtobufMessage, Uuid};
use libsignal_service::profile_cipher::ProfileCipher;
use libsignal_service::proto::data_message::Delete;
use libsignal_service::proto::{
Expand Down Expand Up @@ -962,7 +962,12 @@ impl<S: Store> Manager<S, Registered> {
.await;

// return first error if any
results.into_iter().find(|res| res.is_err()).transpose()?;
// Ignore any NotFound errors, those mean that e.g. some contact in a group deleted his account.
// TODO: Handle the NotFound error in the future by removing all sessions to this UUID and marking it as unregistered, not sending any messages to him anymore.
results
.into_iter()
.find(|res| res.is_err() && !matches!(res, Err(MessageSenderError::NotFound { .. })))
.transpose()?;

let content = Content {
metadata: Metadata {
Expand Down

0 comments on commit 44ef9df

Please sign in to comment.