Files
session-ios/SessionMessagingKit/Database/Migrations/_024_ResetUserConfigLastHashes.swift
Morgan Pretty 5e384eb7fb Moved and renamed remaining API definitions
• Cleaned up API structures to be more consistent
• Moved OpenGroupAPI into SessionNetworkingKit
• Moved PushNotificationAPI into SessionNetworkingKit
• Renamed to OpenGroupAPI to SOGSAPI
2025-09-15 14:22:39 +10:00

24 lines
1.1 KiB
Swift

// Copyright © 2025 Rangeproof Pty Ltd. All rights reserved.
import Foundation
import GRDB
import SessionNetworkingKit
import SessionUtilitiesKit
/// This migration resets the `lastHash` value for all user config namespaces to force the app to fetch the latest config
/// messages in case there are multi-part config message we had previously seen and failed to merge
enum _024_ResetUserConfigLastHashes: Migration {
static let identifier: String = "snodeKit.ResetUserConfigLastHashes"
static let minExpectedRunDuration: TimeInterval = 0.1
static let createdTables: [(TableRecord & FetchableRecord).Type] = []
static func migrate(_ db: ObservingDatabase, using dependencies: Dependencies) throws {
try db.execute(literal: """
DELETE FROM snodeReceivedMessageInfo
WHERE namespace IN (\(Network.SnodeAPI.Namespace.configContacts.rawValue), \(Network.SnodeAPI.Namespace.configUserProfile.rawValue), \(Network.SnodeAPI.Namespace.configUserGroups.rawValue), \(Network.SnodeAPI.Namespace.configConvoInfoVolatile.rawValue))
""")
MigrationExecution.updateProgress(1)
}
}