Skip to content

Commit ec43f85

Browse files
authored
Merge pull request #840 from splitio/master
Update development branch
2 parents 6aa00ee + 9e2aafe commit ec43f85

13 files changed

Lines changed: 613 additions & 37 deletions

CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
3.7.1: (Feb 19, 2026)
2+
- Improved impressions persistence and submission.
3+
14
3.7.0: (Jan 28, 2026)
25
- Added functionality to provide metadata alongside SDK update and READY events. Read more in our docs.
36

NOTICE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Harness Feature Management JavaScript SDK Copyright 2024-2026 Harness Inc.
1+
Harness Feature Management iOS SDK Copyright 2024-2026 Harness Inc.
22

33
This product includes software developed at Harness Inc. (https://harness.io/).
44

Split.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22
s.name = 'Split'
33
s.module_name = 'Split'
4-
s.version = '3.7.0'
4+
s.version = '3.7.1'
55
s.summary = 'iOS SDK for Split'
66
s.description = <<-DESC
77
This SDK is designed to work with Split, the platform for controlled rollouts, serving features to your users via the Split feature flag to manage your complete customer experience.

Split/Common/Utils/Version.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Foundation
1010
class Version {
1111
private static let kSdkPlatform: String = "ios"
1212

13-
private static let kVersion = "3.7.0"
13+
private static let kVersion = "3.7.1"
1414

1515
static var semantic: String {
1616
return kVersion

Split/FetcherEngine/Recorder/ImpressionsRecorderWorker.swift

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class ImpressionsRecorderWorker: RecorderWorker, @unchecked Sendable {
2929

3030
func flush() {
3131
var rowCount = 0
32-
var failedImpressions = [KeyImpression]()
32+
var failedCount = 0
3333
repeat {
3434
let impressions = persistentImpressionsStorage.pop(count: impressionsPerPush)
3535
rowCount = impressions.count
@@ -42,18 +42,17 @@ class ImpressionsRecorderWorker: RecorderWorker, @unchecked Sendable {
4242
Logger.i("Impressions posted successfully")
4343
} catch let error {
4444
Logger.e("Impression error: \(String(describing: error))")
45-
failedImpressions.append(contentsOf: impressions)
45+
// Impressions remain in DB for retry on next flush cycle
46+
failedCount = rowCount
47+
break
4648
}
4749
}
4850
} while rowCount == impressionsPerPush
49-
// Activate non sent impressions to retry in next iteration
50-
persistentImpressionsStorage.setActive(failedImpressions)
5151
if let syncHelper = impressionsSyncHelper {
52-
syncHelper.updateAccumulator(count: failedImpressions.count,
53-
bytes: failedImpressions.count *
52+
syncHelper.updateAccumulator(count: failedCount,
53+
bytes: failedCount *
5454
ServiceConstants.estimatedImpressionSizeInBytes)
5555
}
56-
5756
}
5857

5958
private func group(impressions: [KeyImpression]) -> [ImpressionsTest] {

Split/Storage/Impressions/ImpressionDao.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class CoreDataImpressionDao: BaseCoreDataDao, ImpressionDao, @unchecked Sendable
5151
return
5252
}
5353

54-
let predicate = NSPredicate(format: "createdAt >= %d AND status == %d", createdAt, status)
54+
let predicate = NSPredicate(format: "createdAt >= %d", createdAt)
5555
let entities = self.coreDataHelper.fetch(entity: .impression,
5656
where: predicate,
5757
rowLimit: maxRows).compactMap { return $0 as? ImpressionEntity }

Split/Storage/Impressions/ImpressionEntity.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class ImpressionEntity: NSManagedObject {
1515
@NSManaged public var storageId: String
1616
@NSManaged public var body: String
1717
@NSManaged public var createdAt: Int64
18+
// status is not queried anymore, but we keep it for backward compatibility
1819
@NSManaged public var status: Int32
1920
@NSManaged public var testName: String
2021
}

Split/Storage/Impressions/PersistentImpressionsStorage.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ class DefaultImpressionsStorage: PersistentImpressionsStorage, @unchecked Sendab
3030
func pop(count: Int) -> [KeyImpression] {
3131
let createdAt = Date().unixTimestamp() - self.expirationPeriod
3232
let impressions = impressionDao.getBy(createdAt: createdAt, status: StorageRecordStatus.active, maxRows: count)
33-
impressionDao.update(ids: impressions.compactMap { $0.storageId }, newStatus: StorageRecordStatus.deleted)
3433
return impressions
3534
}
3635

SplitTests/Fake/Storage/PersistentImpressionsStorageStub.swift

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,7 @@ class PersistentImpressionsStorageStub: PersistentImpressionsStorage, @unchecked
2626
}
2727

2828
func pop(count: Int) -> [KeyImpression] {
29-
let deleted = impressionsStatus.filter { $0.value == StorageRecordStatus.deleted }.keys
30-
let poped = Array(storedImpressions.values.filter { !deleted.contains($0.storageId ?? "") }.prefix(count))
31-
for impression in poped {
32-
impressionsStatus[impression.storageId ?? ""] = StorageRecordStatus.deleted
33-
}
34-
return poped
29+
return Array(storedImpressions.values.prefix(count))
3530
}
3631

3732
func push(impression: KeyImpression) {

0 commit comments

Comments
 (0)