Repository navigation
feat(ios): keep recorded messages across relaunches - #300
Merged
Merged
Conversation
Opt-in persistsMessages writes each change to an id-prefixed JSON Lines file; start() reads only the last id and merges stored messages in the background, as Android loads Room asynchronously. Closes #297
Compact after each launch's merge, start on a fresh line after a partial one, decode off the file queue, and share one handle per file.
|
Caution Review failedThe pull request is closed.
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Opt-in
DariConfiguration(persistsMessages: true)keeps recorded messages across relaunches and crashes on iOS, as Android does with Room. Closes #297.Changes
MessageFileStorewrites one<id>\t<json>line (versioned DTO) per added or updated message toApplication Support/Dari/messages.jsonl..completeUntilFirstUserAuthentication.start()only scans the id prefixes, so live ids continue after stored ones.maxEntriesandretentionPeriodapply during the merge.clearedand then every record in order, and the file is compacted.clear()deletes the file. Starting withpersistsMessages: falsedeletes it too.stop()keeps it for the nextstart().DariLoopbackDemogets--persistand--crash[=<ms>].Notes for reviewers
start()blocks 0–12 ms, even for a 123 MB file.swift test, with newMessageFileStoreTestsDariLoopbackDemo