Fix thread hole index

This commit is contained in:
Ali
2020-09-23 22:59:04 +04:00
parent 783cbb64af
commit 13550ea6fa
2 changed files with 2 additions and 0 deletions

View File

@@ -81,6 +81,7 @@ final class MessageHistoryMetadataTable: Table {
private func peerThreadHoleIndexInitializedKey(peerId: PeerId, threadId: Int64) -> ValueBoxKey { private func peerThreadHoleIndexInitializedKey(peerId: PeerId, threadId: Int64) -> ValueBoxKey {
self.sharedPeerThreadHoleIndexInitializedKey.setInt64(0, value: peerId.toInt64()) self.sharedPeerThreadHoleIndexInitializedKey.setInt64(0, value: peerId.toInt64())
self.sharedPeerThreadHoleIndexInitializedKey.setInt8(8, value: MetadataPrefix.PeerHistoryThreadHoleIndexInitialized.rawValue) self.sharedPeerThreadHoleIndexInitializedKey.setInt8(8, value: MetadataPrefix.PeerHistoryThreadHoleIndexInitialized.rawValue)
self.sharedPeerThreadHoleIndexInitializedKey.setInt64(0, value: threadId)
return self.sharedPeerThreadHoleIndexInitializedKey return self.sharedPeerThreadHoleIndexInitializedKey
} }

View File

@@ -110,6 +110,7 @@ final class MessageHistoryThreadHoleIndexTable: Table {
private func ensureInitialized(peerId: PeerId, threadId: Int64) { private func ensureInitialized(peerId: PeerId, threadId: Int64) {
if !self.metadataTable.isThreadHoleIndexInitialized(peerId: peerId, threadId: threadId) { if !self.metadataTable.isThreadHoleIndexInitialized(peerId: peerId, threadId: threadId) {
postboxLog("MessageHistoryThreadHoleIndexTable: Initializing \(peerId) \(threadId)")
self.metadataTable.setIsThreadHoleIndexInitialized(peerId: peerId, threadId: threadId) self.metadataTable.setIsThreadHoleIndexInitialized(peerId: peerId, threadId: threadId)
if let messageNamespaces = self.seedConfiguration.messageThreadHoles[peerId.namespace] { if let messageNamespaces = self.seedConfiguration.messageThreadHoles[peerId.namespace] {