Fix thread updating issue

pull/313/head
nielsandriesse 5 years ago
parent ce7a23c401
commit 70fb7eb185

@ -15,7 +15,7 @@ extension Storage {
} }
return try! promise.wait() return try! promise.wait()
} }
/// Returns the ID of the thread the message was stored under along with the ID of the `TSIncomingMessage` that was constructed. /// Returns the ID of the thread the message was stored under along with the ID of the `TSIncomingMessage` that was constructed.
public func persist(_ message: VisibleMessage, groupPublicKey: String?, using transaction: Any) -> (String, String)? { public func persist(_ message: VisibleMessage, groupPublicKey: String?, using transaction: Any) -> (String, String)? {
let transaction = transaction as! YapDatabaseReadWriteTransaction let transaction = transaction as! YapDatabaseReadWriteTransaction
@ -30,6 +30,7 @@ extension Storage {
guard let thread = threadOrNil else { return nil } guard let thread = threadOrNil else { return nil }
let message = TSIncomingMessage.from(message, associatedWith: thread) let message = TSIncomingMessage.from(message, associatedWith: thread)
message.save(with: transaction) message.save(with: transaction)
DispatchQueue.main.async { message.touch() } // FIXME: Hack for a thread updating issue
return (thread.uniqueId!, message.uniqueId!) return (thread.uniqueId!, message.uniqueId!)
} }
@ -59,3 +60,4 @@ extension Storage {
tsIncomingMessage.touch(with: transaction) tsIncomingMessage.touch(with: transaction)
} }
} }

Loading…
Cancel
Save