feat(remote-config): store inlined blobs to disk#7073
Conversation
4 builds increased size
RevenueCat 1.0 (1)
|
| Item | Install Size Change |
|---|---|
| DYLD.String Table | ⬆️ 73.2 kB |
| Code Signature | ⬆️ 5.6 kB |
| DYLD.Exports | ⬆️ 5.6 kB |
| Strings.Unmapped | ⬆️ 1.2 kB |
| 📝 RevenueCat.RemoteConfigManager.RemoteConfigManager | ⬆️ 548 B |
BinarySizeTest 1.0 (1)
com.revenuecat.binary-size-test.local-source
⚖️ Compare build
📦 Install build
⏱️ Analyze build performance
Total install size change: ⬆️ 28.9 kB (0.22%)
Total download size change: ⬆️ 8.3 kB (0.19%)
Largest size changes
| Item | Install Size Change |
|---|---|
| 📝 RevenueCat.RemoteConfigStrings.value witness | ⬆️ 8.7 kB |
| DYLD.String Table | ⬆️ 1.7 kB |
| 📝 RevenueCat.RCContainer.Element.withBytes(in) | ⬆️ 1.6 kB |
| 🗑 RevenueCat.RCContainer.Parser.checksumString(in) | ⬇️ -1.5 kB |
| 📝 RevenueCat.RemoteConfigStrings.description | ⬆️ 1.4 kB |
BinarySizeTest 1.0 (1)
com.revenuecat.binary-size-test.cocoapods
⚖️ Compare build
📦 Install build
⏱️ Analyze build performance
Total install size change: ⬆️ 50.0 kB (0.17%)
Total download size change: ⬆️ 14.4 kB (0.22%)
Largest size changes
| Item | Install Size Change |
|---|---|
| DYLD.String Table | ⬆️ 14.3 kB |
| 📝 RevenueCat.RemoteConfigStrings.value witness | ⬆️ 8.7 kB |
| 📝 RevenueCat.RCContainer.Element.withBytes(in) | ⬆️ 1.6 kB |
| 🗑 RevenueCat.RCContainer.Parser.checksumString(in) | ⬇️ -1.5 kB |
| Code Signature | ⬆️ 1.5 kB |
BinarySizeTest 1.0 (1)
com.revenuecat.binary-size-test.spm
⚖️ Compare build
📦 Install build
⏱️ Analyze build performance
Total install size change: ⬆️ 25.3 kB (0.22%)
Total download size change: ⬆️ 7.2 kB (0.16%)
Largest size changes
| Item | Install Size Change |
|---|---|
| 📝 RevenueCat.RemoteConfigStrings.value witness | ⬆️ 8.7 kB |
| 📝 RevenueCat.RCContainer.Element.withBytes(in) | ⬆️ 1.6 kB |
| 🗑 RevenueCat.RCContainer.Parser.checksumString(in) | ⬇️ -1.5 kB |
| 📝 RevenueCat.RemoteConfigStrings.description | ⬆️ 1.4 kB |
| 📝 RevenueCat.RCContainer.Element.payloadChecksum | ⬆️ 1.4 kB |
🛸 Powered by Emerge Tools
Comment trigger: Size diff threshold of 100.00kB exceeded
❌ CI Job Failed —
|
6395a96 to
75cb074
Compare
75cb074 to
8bb16f8
Compare
df013db to
bc6262d
Compare
8bb16f8 to
c61505d
Compare
bc6262d to
0efbcc6
Compare
c61505d to
00af423
Compare
|
@RCGitBot please test |
|
@RCGitBot please test |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
❌ 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 3e8be9b. Configure here.
c2e57c7 to
560c8e3
Compare
b1aa3e8 to
eddd148
Compare
560c8e3 to
f87390e
Compare
eddd148 to
21b1db7
Compare





Part of a stack of PRs, builds on #7074 and aligned with Android PR RevenueCat/purchases-android#3615.
How it works
The decision on when to store / delete / keep (inlined) blobs on disk can get a bit complicated, so I generated some psuedo code that might help understand the process.
So basically the blob refs we want to keep are:
After that we'll store any inlined blobs if they are in the
blobRefsToKeeplist and valid (checksum matches) and we'll delete any cached blobs if they are no longer inblobRefsToKeepNote
Medium Risk
Changes remote config on-disk state, blob retention, and what the SDK tells the server it already has; mistakes could drop cached blobs or skew sync, though checksum checks, ref validation, and tests mitigate this.
Overview
Adds a content-addressed on-disk blob cache (
RemoteConfigBlobStore) under remote config storage and wires it into refresh persistence so inline container payloads can be kept locally across launches.On a successful container response,
RemoteConfigManagernow computes which blob refs should exist (responseprefetch_blobsplus active-topic refs after merging/pruning), writes only referenced inline elements with valid checksums, persists JSON state (including newprefetchedBlobRefsfor refs actually present on disk), and prunes the blob directory viaretainOnly—but only after the disk cache write succeeds. Refresh requests advertiseprefetchedBlobsusing persisted refs that still exist in the blob store, not the full server prefetch list.RemoteConfigDiskCache.writereturnsBool; sharedRemoteConfigStoragecentralizes the config directory path. New log strings cover blob read/write/delete and invalid checksum skips. Unit tests cover the blob store (including malformed ref rejection) and expanded manager/cache behavior.Reviewed by Cursor Bugbot for commit 21b1db7. Bugbot is set up for automated code reviews on this repo. Configure here.