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 { guard let thread: SessionThread = Storage.shared.read({ db in try? SessionThread.fetchOne(db, id: details.groupPublicKey)}) else {
SNLog("Can't leave nonexistent closed group.") SNLog("Can't leave nonexistent closed group.")
failure(job, MessageSenderError.noThread, false) failure(job, MessageSenderError.noThread, true)
return return
} }
guard let closedGroup: ClosedGroup = Storage.shared.read({ db in try? thread.closedGroup.fetchOne(db)}) else { 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 return
} }

Loading…
Cancel
Save