refactor(remote-config): make rc container validation domain-specific#7074
refactor(remote-config): make rc container validation domain-specific#7074rickvdl wants to merge 16 commits into
Conversation
4 builds increased size
RevenueCat 1.0 (1)
|
| Item | Install Size Change |
|---|---|
| DYLD.String Table | ⬆️ 54.6 kB |
| DYLD.Exports | ⬆️ 4.7 kB |
| Code Signature | ⬆️ 4.4 kB |
| 📝 RCWebPurchaseRedemption.init | ⬆️ 2.9 kB |
| RCWebPurchaseRedemption.Objc Metadata | ⬇️ -2.9 kB |
BinarySizeTest 1.0 (1)
com.revenuecat.binary-size-test.local-source
⚖️ Compare build
📦 Install build
⏱️ Analyze build performance
Total install size change: ⬆️ 21.5 kB (0.17%)
Total download size change: ⬆️ 6.1 kB (0.14%)
Largest size changes
| Item | Install Size Change |
|---|---|
| 📝 RevenueCat.RemoteConfigStrings.value witness | ⬆️ 7.9 kB |
| 📝 RevenueCat.RCContainer.Element.withBytes(in) | ⬆️ 1.6 kB |
| 🗑 RevenueCat.RCContainer.Parser.checksumString(in) | ⬇️ -1.5 kB |
| DYLD.String Table | ⬆️ 1.4 kB |
| 📝 RevenueCat.RCContainer.Element.payloadChecksum | ⬆️ 1.4 kB |
BinarySizeTest 1.0 (1)
com.revenuecat.binary-size-test.cocoapods
⚖️ Compare build
📦 Install build
⏱️ Analyze build performance
Total install size change: ⬆️ 42.6 kB (0.15%)
Total download size change: ⬆️ 11.6 kB (0.18%)
Largest size changes
| Item | Install Size Change |
|---|---|
| DYLD.String Table | ⬆️ 12.5 kB |
| 📝 RevenueCat.RemoteConfigStrings.value witness | ⬆️ 7.9 kB |
| 📝 RevenueCat.RCContainer.Element.withBytes(in) | ⬆️ 1.6 kB |
| 🗑 RevenueCat.RCContainer.Parser.checksumString(in) | ⬇️ -1.5 kB |
| 📝 RevenueCat.RCContainer.Element.payloadChecksum | ⬆️ 1.4 kB |
BinarySizeTest 1.0 (1)
com.revenuecat.binary-size-test.spm
⚖️ Compare build
📦 Install build
⏱️ Analyze build performance
Total install size change: ⬆️ 21.7 kB (0.19%)
Total download size change: ⬆️ 4.4 kB (0.1%)
Largest size changes
| Item | Install Size Change |
|---|---|
| 📝 RevenueCat.RemoteConfigStrings.value witness | ⬆️ 7.9 kB |
| 📝 RevenueCat.RCContainer.Element.withBytes(in) | ⬆️ 1.6 kB |
| 🗑 RevenueCat.RCContainer.Parser.checksumString(in) | ⬇️ -1.5 kB |
| 📝 RevenueCat.RCContainer.Element.payloadChecksum | ⬆️ 1.4 kB |
| 📝 RevenueCat.RemoteConfigContainer.init(rcContainer) | ⬆️ 1.3 kB |
🛸 Powered by Emerge Tools
Comment trigger: Size diff threshold of 100.00kB exceeded
989bde7 to
96e80a7
Compare
96e80a7 to
d313b32
Compare
df013db to
bc6262d
Compare
d676892 to
55b2419
Compare
55b2419 to
a6a12e7
Compare
bc6262d to
0efbcc6
Compare
|
@RCGitBot please test |
a6a12e7 to
20ebc3d
Compare
c2e57c7 to
560c8e3
Compare
❌ CI Job Failed —
|
20ebc3d to
572b0f3
Compare
560c8e3 to
f87390e
Compare
f7ef32f to
e8b227e
Compare




Part of a stack of PRs, builds on #7067 and aligned with Android PR RevenueCat/purchases-android#3615.
Refactors part of the
RCContainer(Element)Parser,RemoteConfigAPIandRCContaineritself to extract it's domain specific logic about the config API into external implementations.RemoteConfigContainerwrapper type, which has the domain knowledge about the config element at index 0RCContainervalidation now no longer validates the element checksums, but only validates it's structureRemoteConfigContainerdirectly in deciding on Request Signature ValidationNote
Medium Risk
Changes remote config decode, persistence inputs, and signature-verification interaction for RC Container responses; behavior is covered by new tests but alters when corrupt inline blobs vs invalid config fail requests.
Overview
RC Container parsing is split from remote-config semantics.
RCContainernow only structurally indexes wire-orderelementsandelementsByChecksum; it no longer treats element 0 as config, requires a config element, or rejects payloads whose checksum does not match during parse. Checksum verification moves ontoRCContainer.ElementviavalidateChecksum()/isChecksumValid().Remote config owns validation policy through a new
RemoteConfigContainertype (also the HTTP response body for/v2/config). It requires a first element, validates only the config element’s checksum, and exposes remaining elements asinlineContentElementswithout checksum enforcement at decode time—so structurally valid but corrupt inline blobs can still be returned while a bad config fails decoding.RemoteConfigManager, fetch results, and signature context now useconfigElement/RemoteConfigContainerinstead ofRCContainer.config.Signature verification behavior shifts for inline corruption: tests now expect a corrupted non-config payload not to fail the HTTP response (signing still uses the config checksum), whereas config checksum mismatch still fails typed parsing.
Reviewed by Cursor Bugbot for commit f87390e. Bugbot is set up for automated code reviews on this repo. Configure here.