This commit is contained in:
overtake 2019-05-21 18:09:03 +02:00
commit eb59174efa
4 changed files with 7 additions and 5 deletions

View File

@ -1,6 +1,6 @@
import Foundation
struct AccountManagerAtomicState: Codable {
final class AccountManagerAtomicState: Codable {
var records: [AccountRecordId: AccountRecord]
var currentRecordId: AccountRecordId?
var currentAuthRecord: AuthAccountRecord?

View File

@ -1,6 +1,6 @@
import Foundation
public protocol AccountRecordAttribute: PostboxCoding {
public protocol AccountRecordAttribute: class, PostboxCoding {
func isEqual(to: AccountRecordAttribute) -> Bool
}
@ -34,7 +34,7 @@ public func generateAccountRecordId() -> AccountRecordId {
return AccountRecordId(rawValue: id)
}
public struct AccountRecord: PostboxCoding, Equatable, Codable {
public final class AccountRecord: PostboxCoding, Equatable, Codable {
enum CodingKeys: String, CodingKey {
case id
case attributes

View File

@ -873,7 +873,9 @@ final class MessageHistoryTable: Table {
if let lower = lower, let upper = upper, let groupInfo = lower.groupInfo, lower.groupingKey == upper.groupingKey {
assert(upper.groupInfo != nil)
if lower.groupInfo != upper.groupInfo {
self.updateSameGroupInfosInNamespace(lowerBound: index, from: upper.groupInfo!, to: groupInfo, updatedGroupInfos: &updatedGroupInfos)
if let upperGroupInfo = upper.groupInfo {
self.updateSameGroupInfosInNamespace(lowerBound: index, from: groupInfo, to: upperGroupInfo, updatedGroupInfos: &updatedGroupInfos)
}
}
}
}

View File

@ -442,7 +442,7 @@ public final class SqliteValueBox: ValueBox {
private func beginInternal(database: Database) {
precondition(self.queue.isCurrent())
let resultCode = database.execute("BEGIN IMMEDIATE")
precondition(resultCode)
assert(resultCode)
}
private func commitInternal(database: Database) {