From 02b2b28cbd20459e548e1da1535ec1dd0e31eb12 Mon Sep 17 00:00:00 2001 From: Nan Date: Thu, 3 Sep 2026 20:30:27 -0700 Subject: [PATCH] chore: pin the KMP submodule to the merged crash-retention commit main pinned 0513bf5, the first commit of the KMP #23 branch, taken while that PR was still being written. bfc679a is the merge on KMP main. Two CrashRetention calls gained a parameter on the way: effectiveWriteTimeMs takes the policy, and isWithinCaps takes the names it must not evict, so the cap check and the eviction selector now measure the same set of files instead of the guard counting an in-flight record the selector would then protect. Android main already uses these signatures. --- OneSignal-KMP-SDK | 2 +- .../OneSignalOSCore/Source/Logging/FileLogStore.swift | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/OneSignal-KMP-SDK b/OneSignal-KMP-SDK index 0513bf5636..bfc679a4c7 160000 --- a/OneSignal-KMP-SDK +++ b/OneSignal-KMP-SDK @@ -1 +1 @@ -Subproject commit 0513bf56367c76439cb33f40a9d28723a2874f0c +Subproject commit bfc679a4c7445cc13f092f9ad1b58af4b3ab8c2c diff --git a/iOS_SDK/OneSignalSDK/OneSignalOSCore/Source/Logging/FileLogStore.swift b/iOS_SDK/OneSignalSDK/OneSignalOSCore/Source/Logging/FileLogStore.swift index f4f6b6da9b..492e52fc68 100644 --- a/iOS_SDK/OneSignalSDK/OneSignalOSCore/Source/Logging/FileLogStore.swift +++ b/iOS_SDK/OneSignalSDK/OneSignalOSCore/Source/Logging/FileLogStore.swift @@ -214,7 +214,10 @@ final class FileLogStore: ILogFileStore { now: Int64, minAgeMillis: Int64 ) -> Bool { - guard let writtenMs = CrashRetention.shared.effectiveWriteTimeMs(entry: entry)?.int64Value else { + guard let writtenMs = CrashRetention.shared.effectiveWriteTimeMs( + entry: entry, + policy: Self.retentionPolicy + )?.int64Value else { return false } return now - writtenMs >= max(0, minAgeMillis) @@ -272,8 +275,11 @@ final class FileLogStore: ILogFileStore { guard let entries = try? directoryEntries() else { return } + // The guard and the selector must see the same names, or they stop measuring the same directory. + let keepNames = snapshotInFlightNames().union([keepName]) guard !CrashRetention.shared.isWithinCaps( entries: entries, + keepNames: keepNames, policy: Self.retentionPolicy ) else { return @@ -281,7 +287,7 @@ final class FileLogStore: ILogFileStore { let overflow = CrashRetention.shared.selectOverflowOwned( entries: entries, nowMs: Self.nowMillis(), - keepNames: snapshotInFlightNames().union([keepName]), + keepNames: keepNames, policy: Self.retentionPolicy ) for entry in overflow {