Skip to content

Commit 3d624c6

Browse files
nan-licursoragent
andcommitted
fix: [SDK-4814] reduce receive-receipt dedup cache TTL to 1 day
Receipts are only enqueued when a push-delivered content update arrives, so the device is online and sends succeed promptly; a long retry window isn't needed. As a dedup marker, an entry only has to outlive the window in which ActivityKit can re-emit an active activity on relaunch (~12h max), so one day covers it with margin while bounding how much the per-notification cache can accumulate. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 0a6d57e commit 3d624c6

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

iOS_SDK/OneSignalSDK/OneSignalLiveActivities/Source/Executors/OSLiveActivitiesExecutor.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,12 @@ class StartRequestCache: RequestCache {
115115
}
116116

117117
class ReceiveReceiptsRequestCache: RequestCache {
118-
// Sent receipts stay as dedup markers (not only pending retries), so re-emits after relaunch aren't re-sent.
119-
static let ThreeDaysInSeconds = TimeInterval(60 * 60 * 24 * 3)
118+
// Sent receipts are kept as dedup markers, so bound retention: an active activity re-emits for at most
119+
// ~12h on relaunch, and updates arrive over the network, so a day covers dedup and retries without piling up.
120+
static let OneDayInSeconds = TimeInterval(60 * 60 * 24)
120121

121122
init() {
122-
super.init(cacheKey: OS_LIVE_ACTIVITIES_EXECUTOR_RECEIVE_RECEIPTS_KEY, ttl: ReceiveReceiptsRequestCache.ThreeDaysInSeconds)
123+
super.init(cacheKey: OS_LIVE_ACTIVITIES_EXECUTOR_RECEIVE_RECEIPTS_KEY, ttl: ReceiveReceiptsRequestCache.OneDayInSeconds)
123124
}
124125
}
125126

0 commit comments

Comments
 (0)