mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-19 12:10:55 +00:00
GlobalMessageIdsTable: added assert
This commit is contained in:
parent
f564c6ad01
commit
78c67b658a
@ -14,6 +14,7 @@ final class GlobalMessageIdsTable: Table {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func set(_ globalId: Int32, id: MessageId) {
|
func set(_ globalId: Int32, id: MessageId) {
|
||||||
|
assert(self.get(globalId) == nil)
|
||||||
self.sharedBuffer.reset()
|
self.sharedBuffer.reset()
|
||||||
var idPeerId: Int64 = id.peerId.toInt64()
|
var idPeerId: Int64 = id.peerId.toInt64()
|
||||||
var idNamespace: Int32 = id.namespace
|
var idNamespace: Int32 = id.namespace
|
||||||
|
@ -996,9 +996,11 @@ public func openPostbox(basePath: String, seedConfiguration: SeedConfiguration)
|
|||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
//debugSaveState(basePath: basePath, name: "previous1")
|
//debugSaveState(basePath: basePath, name: "previous1")
|
||||||
//debugRestoreState(basePath: basePath, name: "previous1")
|
debugRestoreState(basePath: basePath, name: "previous1")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
var debugFirstTime = true
|
||||||
|
|
||||||
loop: while true {
|
loop: while true {
|
||||||
let valueBox = SqliteValueBox(basePath: basePath + "/db", queue: queue)
|
let valueBox = SqliteValueBox(basePath: basePath + "/db", queue: queue)
|
||||||
|
|
||||||
@ -1007,7 +1009,11 @@ public func openPostbox(basePath: String, seedConfiguration: SeedConfiguration)
|
|||||||
let userVersion: Int32? = metadataTable.userVersion()
|
let userVersion: Int32? = metadataTable.userVersion()
|
||||||
let currentUserVersion: Int32 = 19
|
let currentUserVersion: Int32 = 19
|
||||||
|
|
||||||
if let userVersion = userVersion {
|
if var userVersion = userVersion {
|
||||||
|
/*if debugFirstTime {
|
||||||
|
debugFirstTime = false
|
||||||
|
userVersion = 18
|
||||||
|
}*/
|
||||||
if userVersion != currentUserVersion {
|
if userVersion != currentUserVersion {
|
||||||
if userVersion > currentUserVersion {
|
if userVersion > currentUserVersion {
|
||||||
postboxLog("Version \(userVersion) is newer than supported")
|
postboxLog("Version \(userVersion) is newer than supported")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user