mirror of https://github.com/oxen-io/session-ios
Fixed a QA issue, a couple edge-cases and cleaned up some logic
• Added the "expired group" banner for when the first poll of an updated group doesn't retrieve config messages • Removed a redundant base64 encode/decode • Removed messy extra message validation function • Fixed an edge-case where a member granted supplemental access to the group could end up incorrectly kicked under the right conditions • Fixed an issue where the copy for deleting a deprecated legacy group wasn't accuratepull/894/head
parent
3f3d4dde26
commit
c99ee90ca6
@ -0,0 +1,37 @@
|
||||
// Copyright © 2025 Rangeproof Pty Ltd. All rights reserved.
|
||||
|
||||
import Foundation
|
||||
import UIKit.UIImage
|
||||
import GRDB
|
||||
import SessionSnodeKit
|
||||
import SessionUtilitiesKit
|
||||
|
||||
enum _023_GroupsExpiredFlag: Migration {
|
||||
static let target: TargetMigrations.Identifier = .messagingKit
|
||||
static let identifier: String = "GroupsExpiredFlag"
|
||||
static let minExpectedRunDuration: TimeInterval = 0.1
|
||||
static var requirements: [MigrationRequirement] = [.sessionIdCached, .libSessionStateLoaded]
|
||||
static var fetchedTables: [(FetchableRecord & TableRecord).Type] = []
|
||||
static var createdOrAlteredTables: [(FetchableRecord & TableRecord).Type] = [ClosedGroup.self]
|
||||
static let droppedTables: [(TableRecord & FetchableRecord).Type] = []
|
||||
|
||||
static func migrate(_ db: Database, using dependencies: Dependencies) throws {
|
||||
try db.alter(table: ClosedGroup.self) { t in
|
||||
t.add(.expired, .boolean).defaults(to: false)
|
||||
}
|
||||
|
||||
Storage.update(progress: 1, for: self, in: target, using: dependencies)
|
||||
}
|
||||
|
||||
struct OpenGroupImageInfo: FetchableRecord, Decodable, ColumnExpressible {
|
||||
typealias Columns = CodingKeys
|
||||
enum CodingKeys: String, CodingKey, ColumnExpression, CaseIterable {
|
||||
case threadId
|
||||
case data = "imageData"
|
||||
}
|
||||
|
||||
let threadId: String
|
||||
let data: Data
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,16 @@
|
||||
// Copyright © 2025 Rangeproof Pty Ltd. All rights reserved.
|
||||
|
||||
import Foundation
|
||||
|
||||
extension DispatchTimeInterval {
|
||||
var milliseconds: Int {
|
||||
switch self {
|
||||
case .seconds(let s): return s * 1_000
|
||||
case .milliseconds(let ms): return ms
|
||||
case .microseconds(let us): return us / 1_000 // integer division truncates any remainder
|
||||
case .nanoseconds(let ns): return ns / 1_000_000
|
||||
case .never: return -1
|
||||
@unknown default: return -1
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue