Skip to content

feat(remote-config): add manifest disk persistence#7076

Merged
rickvdl merged 13 commits into
mainfrom
rickvdl/remote-config-manifest-cache
Jun 25, 2026
Merged

feat(remote-config): add manifest disk persistence#7076
rickvdl merged 13 commits into
mainfrom
rickvdl/remote-config-manifest-cache

Conversation

@rickvdl

@rickvdl rickvdl commented Jun 24, 2026

Copy link
Copy Markdown
Member

Part of a stack of PRs, builds on #7046 and should be aligned with the Android equivalent in RevenueCat/purchases-android#3612.

Description

  • Introduces the RemoteConfigDiskCache for storing the latest manifest, topic blob refs and other data through the PersistedRemoteConfiguration type.

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 RemoteConfigDiskCache and PersistedRemoteConfiguration (manifest, domain, active topics, prefetch blobs, topic blob refs, lastRefreshAt), backed by SynchronizedLargeItemCache under remote_config/remote_config.json (Application Support on most platforms, cache on tvOS).

RemoteConfigStrings logs read/write failures; RemoteConfiguration.defaultDomain is shared with RemoteConfigRequest instead of a local "app" constant. PersistedRemoteConfiguration decoding tolerates missing fields and ignores legacy on-disk topics bodies. A small file overwrite test was added in LargeItemCacheTypeTests.

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.

@rickvdl rickvdl changed the title feat(remote-config): add manifest disk cache feat(remote-config): add manifest disk persistence Jun 24, 2026
@rickvdl rickvdl force-pushed the rickvdl/remote-config-rc-container-signing branch from 41ad3fe to fbcb45e Compare June 24, 2026 11:07
@rickvdl rickvdl force-pushed the rickvdl/remote-config-manifest-cache branch from 7df5554 to af1f08a Compare June 24, 2026 11:08
@emerge-tools

emerge-tools Bot commented Jun 24, 2026

Copy link
Copy Markdown

4 builds increased size

Name Version Download Change Install Change Approval
RevenueCat
com.revenuecat.PaywallsTester
1.0 (1) 18.9 MB ⬆️ 15.7 kB (0.08%) 68.4 MB ⬆️ 60.9 kB (0.09%) N/A
BinarySizeTest
com.revenuecat.binary-size-test.local-source
1.0 (1) 4.4 MB ⬇️ 159 B 13.1 MB ⬆️ 1.9 kB (0.01%) N/A
BinarySizeTest
com.revenuecat.binary-size-test.cocoapods
1.0 (1) 6.6 MB ⬆️ 1.1 kB (0.02%) 28.9 MB ⬆️ 6.1 kB (0.02%) N/A
BinarySizeTest
com.revenuecat.binary-size-test.spm
1.0 (1) 4.5 MB ⬇️ 1.2 kB (-0.03%) 11.5 MB ⬆️ 1.8 kB (0.02%) N/A

RevenueCat 1.0 (1)
com.revenuecat.PaywallsTester

⚖️ Compare build
⏱️ Analyze build performance

Total install size change: ⬆️ 60.9 kB (0.09%)
Total download size change: ⬆️ 15.7 kB (0.08%)

Largest size changes

Item Install Size Change
DYLD.String Table ⬆️ 18.7 kB
DYLD.Exports ⬆️ 1.7 kB
Code Signature ⬆️ 1.2 kB
Other ⬆️ 39.2 kB
View Treemap

Image of diff

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
View Treemap

Image of diff

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
View Treemap

Image of diff

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
View Treemap

Image of diff


🛸 Powered by Emerge Tools

@rickvdl

rickvdl commented Jun 24, 2026

Copy link
Copy Markdown
Member Author

@RCGitBot please test

@rickvdl

rickvdl commented Jun 24, 2026

Copy link
Copy Markdown
Member Author

@tonidero I extracted the manifest persistence work into a separate PR to keep the PR size below the limits

@rickvdl rickvdl marked this pull request as ready for review June 24, 2026 11:34
@rickvdl rickvdl requested a review from a team as a code owner June 24, 2026 11:34
Comment thread Sources/Networking/RemoteConfigDiskCache.swift Outdated
@rickvdl

rickvdl commented Jun 25, 2026

Copy link
Copy Markdown
Member Author

@RCGitBot please test

@rickvdl rickvdl force-pushed the rickvdl/remote-config-rc-container-signing branch from fbcb45e to 0e2b685 Compare June 25, 2026 06:21
@rickvdl rickvdl force-pushed the rickvdl/remote-config-manifest-cache branch 2 times, most recently from d8380ab to 4af87a6 Compare June 25, 2026 07:09
Comment thread Sources/Networking/Responses/RemoteConfiguration.swift Outdated
Comment thread Sources/Networking/RemoteConfigDiskCache.swift
Comment thread Sources/Networking/Responses/RemoteConfiguration.swift Outdated
Comment thread Sources/Networking/RemoteConfigDiskCache.swift
Comment thread Sources/Networking/RemoteConfigDiskCache.swift Outdated
@rickvdl

rickvdl commented Jun 25, 2026

Copy link
Copy Markdown
Member Author

@RCGitBot please test

1 similar comment
@rickvdl

rickvdl commented Jun 25, 2026

Copy link
Copy Markdown
Member Author

@RCGitBot please test

@rickvdl rickvdl force-pushed the rickvdl/remote-config-manifest-cache branch from d9de11a to 8950dab Compare June 25, 2026 13:36
@rickvdl rickvdl requested a review from ajpallares June 25, 2026 13:43

@tonidero tonidero left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread Sources/Misc/Concurrency/SynchronizedLargeItemCache.swift Outdated
let manifest: RemoteConfigManifestToken
let activeTopics: [String]
let prefetchBlobs: [String]
let topicBlobRefs: [String: [String]]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I have noted that for the follow up PR. Thanks!

@rickvdl rickvdl force-pushed the rickvdl/remote-config-rc-container-signing branch from d4be3c0 to 7f539c0 Compare June 25, 2026 14:12
@rickvdl rickvdl force-pushed the rickvdl/remote-config-manifest-cache branch from 0e55d5e to caff100 Compare June 25, 2026 14:18
@rickvdl rickvdl force-pushed the rickvdl/remote-config-rc-container-signing branch from 7f539c0 to 05c7ac5 Compare June 25, 2026 14:30
@rickvdl rickvdl force-pushed the rickvdl/remote-config-manifest-cache branch from caff100 to 25ac068 Compare June 25, 2026 14:46
@rickvdl

rickvdl commented Jun 25, 2026

Copy link
Copy Markdown
Member Author

@RCGitBot please test

Base automatically changed from rickvdl/remote-config-rc-container-signing to main June 25, 2026 15:04
@rickvdl rickvdl force-pushed the rickvdl/remote-config-manifest-cache branch from 25ac068 to 97e93b7 Compare June 25, 2026 15:16
@rickvdl

rickvdl commented Jun 25, 2026

Copy link
Copy Markdown
Member Author

@RCGitBot please test

@emerge-tools

emerge-tools Bot commented Jun 25, 2026

Copy link
Copy Markdown

📸 Snapshot Test

1 modified, 858 unchanged

Name Added Removed Modified Renamed Unchanged Errored Approval
Paywall Rendering Validation (ios)
com.revenuecat.paywall-rendering-validation.ios
0 0 1 0 129 0 ✅ Approved
PaywallsTester V1 swift-snapshot-testing
com.revenuecat.PaywallsTester.v1-snapshots
0 0 0 0 65 0 N/A
Paywall Rendering Validation (mac-catalyst-optimized-for-mac)
com.revenuecat.paywall-rendering-validation.mac-catalyst-optimized-for-mac
0 0 0 0 130 0 N/A
RevenueCat
com.revenuecat.PaywallsTester
0 0 0 0 274 0 N/A
Paywall Rendering Validation (mac-native)
com.revenuecat.paywall-rendering-validation.mac-native
0 0 0 0 130 0 N/A
Paywall Rendering Validation (mac-catalyst-scaled-to-match-ipad)
com.revenuecat.paywall-rendering-validation.mac-catalyst-scaled-to-match-ipad
0 0 0 0 130 0 N/A

🛸 Powered by Emerge Tools

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread Sources/Caching/LargeItemCacheType.swift Outdated
@rickvdl

rickvdl commented Jun 25, 2026

Copy link
Copy Markdown
Member Author

@RCGitBot please test

@rickvdl rickvdl merged commit 52f0ee8 into main Jun 25, 2026
44 checks passed
@rickvdl rickvdl deleted the rickvdl/remote-config-manifest-cache branch June 25, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants