Added more logs for debugging

pull/751/head
Morgan Pretty 1 year ago
parent 44824c8127
commit 9c2ec47557

@ -421,6 +421,7 @@ public struct Interaction: Codable, Identifiable, Equatable, FetchableRecord, Mu
}
public mutating func didInsert(_ inserted: InsertionSuccess) {
SNLog("[MessageSendDebugging] didInsert interaction for id: \(inserted.rowID)")
self.id = inserted.rowID
}
}

@ -55,6 +55,7 @@ public enum MessageSendJob: JobExecutor {
// message was deleted before it even got sent)
guard Storage.shared.read({ db in try Interaction.exists(db, id: interactionId) }) == true else {
SNLog("[MessageSendJob] Failing due to missing interaction")
SNLog("[MessageSendDebugging] Failed with interactionId \(interactionId)")
failure(job, StorageError.objectNotFound, true)
return
}

@ -69,7 +69,7 @@ extension MessageSender {
)
return
}
SNLog("[MessageSendDebugging] Add send job for interactionId: \(interactionId)\n\(Thread.callStackSymbols)")
JobRunner.add(
db,
job: Job(

@ -1073,7 +1073,7 @@ public final class MessageSender {
{
if let message = message as? VisibleMessage { message.syncTarget = publicKey }
if let message = message as? ExpirationTimerUpdate { message.syncTarget = publicKey }
SNLog("[MessageSendDebugging] Send sync message for interactionId \(interactionId)")
JobRunner.add(
db,
job: Job(

@ -1104,7 +1104,7 @@ private final class JobQueue {
updatedFailureCount <= maxFailureCount
)
else {
SNLog("[JobRunner] \(queueContext) \(job.variant) failed permanently\(maxFailureCount >= 0 ? "; too many retries" : "")")
SNLog("[JobRunner] \(queueContext) \(job.variant) failed permanently\(maxFailureCount >= 0 && updatedFailureCount > maxFailureCount ? "; too many retries" : "")")
// If the job permanently failed or we have performed all of our retry attempts
// then delete the job and all of it's dependant jobs (it'll probably never succeed)

Loading…
Cancel
Save