Skip to content

feat(ios): add a retentionPeriod option - #291

Merged
easyhooon merged 2 commits into
mainfrom
feat/ios-retention-period
Nov 12, 2026
Merged

easyhooon merged 2 commits into
mainfrom
feat/ios-retention-period

Conversation

@easyhooon

@easyhooon easyhooon commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

Adds DariConfiguration.retentionPeriod to the iOS SDK, matching Android's DariConfig.retentionPeriod. Closes #286.

Changes

  • DariConfiguration(retentionPeriod: TimeInterval? = nil), in seconds. nil keeps today's behavior; a non-positive value fails start() like Android's require.
  • MessageStore.add drops records whose requestTimestamp is older than now - retentionPeriod, the same cutoff as RetentionPolicy in dari-runtime. A record stamped exactly at the cutoff is kept.
  • Very large values (.infinity) saturate to Int64.max milliseconds instead of trapping, as Kotlin's inWholeMilliseconds does.
  • README platform table and ios/index.mdx (+ ko) option tables updated.

Notes for reviewers

  • Pruned records send no event to a connected desktop, same as Android's TTL and the existing maxEntries trim. Until Clear, a reconnect or the desktop's 2,000-row cap, the desktop keeps showing them, and opening one returns not found. A removal event would need a protocol change on both platforms, so it's left as a follow-up (noted on feat(ios): add a retentionPeriod option #286).
  • swift test passes, including three new MessageStore tests.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

Pre-merge checks: Passed 1 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Title check Pending This assessment has not completed. The check will be retried on the next pre-merge check run.
Passed Passed checks: 1 passed

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Prunes on insert with Android's RetentionPolicy cutoff; no removal event, as on Android.

Closes #286
@easyhooon
easyhooon force-pushed the feat/ios-retention-period branch from 4358edc to 01038b5 Compare November 12, 2026 04:36
@easyhooon
easyhooon marked this pull request as ready for review November 12, 2026 06:34
@easyhooon
easyhooon merged commit 3bcefcd into main Nov 12, 2026
8 checks passed
@easyhooon
easyhooon deleted the feat/ios-retention-period branch November 12, 2026 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(ios): add a retentionPeriod option

1 participant