fail the group leaving job permanently if there is no thread or closed group record

pull/799/head
ryanzhao 3 years ago
parent 57289158e2
commit 3a7517ec64

@ -30,12 +30,12 @@ public enum GroupLeavingJob: JobExecutor {
guard let thread: SessionThread = Storage.shared.read({ db in try? SessionThread.fetchOne(db, id: details.groupPublicKey)}) else {
SNLog("Can't leave nonexistent closed group.")
failure(job, MessageSenderError.noThread, false)
failure(job, MessageSenderError.noThread, true)
return
}
guard let closedGroup: ClosedGroup = Storage.shared.read({ db in try? thread.closedGroup.fetchOne(db)}) else {
failure(job, MessageSenderError.invalidClosedGroupUpdate, false)
failure(job, MessageSenderError.invalidClosedGroupUpdate, true)
return
}

Loading…
Cancel
Save