feat(remote-config): add manifest disk persistence#7076
Conversation
41ad3fe to
fbcb45e
Compare
7df5554 to
af1f08a
Compare
4 builds increased size
RevenueCat 1.0 (1)
|
| Item | Install Size Change |
|---|---|
| DYLD.String Table | ⬆️ 18.7 kB |
| DYLD.Exports | ⬆️ 1.7 kB |
| Code Signature | ⬆️ 1.2 kB |
| Other | ⬆️ 39.2 kB |
BinarySizeTest 1.0 (1)
com.revenuecat.binary-size-test.local-source
⚖️ Compare build
📦 Install build
⏱️ Analyze build performance
Total install size change: ⬆️ 1.9 kB (0.01%)
Total download size change: ⬇️ 159 B
Largest size changes
| Item | Install Size Change |
|---|---|
| Other | ⬆️ 1.9 kB |
BinarySizeTest 1.0 (1)
com.revenuecat.binary-size-test.cocoapods
⚖️ Compare build
📦 Install build
⏱️ Analyze build performance
Total install size change: ⬆️ 6.1 kB (0.02%)
Total download size change: ⬆️ 1.1 kB (0.02%)
Largest size changes
| Item | Install Size Change |
|---|---|
| DYLD.String Table | ⬆️ 3.1 kB |
| Other | ⬆️ 2.9 kB |
BinarySizeTest 1.0 (1)
com.revenuecat.binary-size-test.spm
⚖️ Compare build
📦 Install build
⏱️ Analyze build performance
Total install size change: ⬆️ 1.8 kB (0.02%)
Total download size change: ⬇️ 1.2 kB (-0.03%)
Largest size changes
| Item | Install Size Change |
|---|---|
| Other | ⬆️ 1.8 kB |
🛸 Powered by Emerge Tools
|
@RCGitBot please test |
|
@tonidero I extracted the manifest persistence work into a separate PR to keep the PR size below the limits |
|
@RCGitBot please test |
fbcb45e to
0e2b685
Compare
d8380ab to
4af87a6
Compare
|
@RCGitBot please test |
1 similar comment
|
@RCGitBot please test |
d9de11a to
8950dab
Compare
tonidero
left a comment
There was a problem hiding this comment.
Not sure if we want to remove the RemoteConfigManifestToken in this PR or a follow-up (or leave it). But in any case, just some non-blocking comments from me
| let manifest: RemoteConfigManifestToken | ||
| let activeTopics: [String] | ||
| let prefetchBlobs: [String] | ||
| let topicBlobRefs: [String: [String]] |
There was a problem hiding this comment.
[not related to this PR]
I do think we will need to revisit the cleanup of topics... This is meant to help knowing which blobs are referenced to cleanup those that aren't, but if a topic item disappears, I believe this won't catch that, and the blob would keep living forever (or until the topic is deleted). Only if there is a modification, this would help delete older blobs I think... In any case, not related to this PR.
There was a problem hiding this comment.
Good point, I have noted that for the follow up PR. Thanks!
d4be3c0 to
7f539c0
Compare
0e55d5e to
caff100
Compare
7f539c0 to
05c7ac5
Compare
caff100 to
25ac068
Compare
|
@RCGitBot please test |
25ac068 to
97e93b7
Compare
|
@RCGitBot please test |
📸 Snapshot Test1 modified, 858 unchanged
🛸 Powered by Emerge Tools |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 97e93b7. Configure here.
|
@RCGitBot please test |





Part of a stack of PRs, builds on #7046 and should be aligned with the Android equivalent in RevenueCat/purchases-android#3612.
Description
RemoteConfigDiskCachefor storing the latest manifest, topic blob refs and other data through thePersistedRemoteConfigurationtype.Reading and writing from/to this persistence layer will be added in a follow up PR.
Note
Low Risk
New isolated persistence layer with no production call sites yet; failures degrade to nil reads and error logs.
Overview
Adds on-disk persistence for remote config sync metadata via
RemoteConfigDiskCacheandPersistedRemoteConfiguration(manifest, domain, active topics, prefetch blobs, topic blob refs,lastRefreshAt), backed bySynchronizedLargeItemCacheunderremote_config/remote_config.json(Application Support on most platforms, cache on tvOS).RemoteConfigStringslogs read/write failures;RemoteConfiguration.defaultDomainis shared withRemoteConfigRequestinstead of a local"app"constant.PersistedRemoteConfigurationdecoding tolerates missing fields and ignores legacy on-disktopicsbodies. A small file overwrite test was added inLargeItemCacheTypeTests.Wiring this cache into fetch/refresh is not in this PR (follow-up).
Reviewed by Cursor Bugbot for commit e07ec6d. Bugbot is set up for automated code reviews on this repo. Configure here.