Skip to content

refactor(remote-config): make rc container validation domain-specific#7074

Open
rickvdl wants to merge 16 commits into
rickvdl/remote-config-manager-config-cachefrom
rickvdl/remote-config-container-validation
Open

refactor(remote-config): make rc container validation domain-specific#7074
rickvdl wants to merge 16 commits into
rickvdl/remote-config-manager-config-cachefrom
rickvdl/remote-config-container-validation

Conversation

@rickvdl

@rickvdl rickvdl commented Jun 23, 2026

Copy link
Copy Markdown
Member

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, RemoteConfigAPI and RCContainer itself to extract it's domain specific logic about the config API into external implementations.

  • Introduces the RemoteConfigContainer wrapper type, which has the domain knowledge about the config element at index 0
  • Moves element checksum validation to the element itself
  • RCContainer validation now no longer validates the element checksums, but only validates it's structure
    • This also allows potentially corrupt blobs to be ignored while still storing valid blobs to disk (storing itself done in a future PR)
  • Remote config endpoint validation now works with the RemoteConfigContainer directly in deciding on Request Signature Validation

Note

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. RCContainer now only structurally indexes wire-order elements and elementsByChecksum; 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 onto RCContainer.Element via validateChecksum() / isChecksumValid().

Remote config owns validation policy through a new RemoteConfigContainer type (also the HTTP response body for /v2/config). It requires a first element, validates only the config element’s checksum, and exposes remaining elements as inlineContentElements without 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 use configElement / RemoteConfigContainer instead of RCContainer.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.

@emerge-tools

emerge-tools Bot commented Jun 23, 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 ⬆️ 48.4 kB (0.26%) 68.5 MB ⬆️ 185.3 kB (0.27%) N/A
BinarySizeTest
com.revenuecat.binary-size-test.local-source
1.0 (1) 4.4 MB ⬆️ 6.1 kB (0.14%) 13.2 MB ⬆️ 21.5 kB (0.17%) N/A
BinarySizeTest
com.revenuecat.binary-size-test.cocoapods
1.0 (1) 6.6 MB ⬆️ 11.6 kB (0.18%) 28.9 MB ⬆️ 42.6 kB (0.15%) ⏳ Needs approval
BinarySizeTest
com.revenuecat.binary-size-test.spm
1.0 (1) 4.5 MB ⬆️ 4.4 kB (0.1%) 11.5 MB ⬆️ 21.7 kB (0.19%) N/A

RevenueCat 1.0 (1)
com.revenuecat.PaywallsTester

⚖️ Compare build
⏱️ Analyze build performance

Total install size change: ⬆️ 185.3 kB (0.27%)
Total download size change: ⬆️ 48.4 kB (0.26%)

Largest size changes

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
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: ⬆️ 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
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: ⬆️ 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
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: ⬆️ 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
View Treemap

Image of diff


🛸 Powered by Emerge Tools

Comment trigger: Size diff threshold of 100.00kB exceeded

@rickvdl

rickvdl commented Jun 23, 2026

Copy link
Copy Markdown
Member Author

@rickvdl rickvdl force-pushed the rickvdl/remote-config-manager-config-cache branch from 989bde7 to 96e80a7 Compare June 23, 2026 14:09
@rickvdl rickvdl force-pushed the rickvdl/remote-config-manager-config-cache branch from 96e80a7 to d313b32 Compare June 23, 2026 14:23
@rickvdl rickvdl force-pushed the rickvdl/remote-config-container-validation branch from df013db to bc6262d Compare June 23, 2026 14:24
@rickvdl rickvdl force-pushed the rickvdl/remote-config-manager-config-cache branch from d676892 to 55b2419 Compare June 24, 2026 10:06
@rickvdl rickvdl force-pushed the rickvdl/remote-config-manager-config-cache branch from 55b2419 to a6a12e7 Compare June 24, 2026 11:09
@rickvdl rickvdl force-pushed the rickvdl/remote-config-container-validation branch from bc6262d to 0efbcc6 Compare June 24, 2026 11:11
@rickvdl rickvdl changed the title feat(remote-config): make rc container validation domain-specific refactor(remote-config): make rc container validation domain-specific Jun 24, 2026
@rickvdl

rickvdl commented Jun 24, 2026

Copy link
Copy Markdown
Member Author

@RCGitBot please test

@rickvdl rickvdl marked this pull request as ready for review June 24, 2026 12:36
@rickvdl rickvdl requested a review from a team as a code owner June 24, 2026 12:36
@rickvdl rickvdl force-pushed the rickvdl/remote-config-manager-config-cache branch from a6a12e7 to 20ebc3d Compare June 25, 2026 06:23
@rickvdl rickvdl force-pushed the rickvdl/remote-config-container-validation branch from c2e57c7 to 560c8e3 Compare June 25, 2026 06:24
@RevenueCat-Danger-Bot

RevenueCat-Danger-Bot commented Jun 25, 2026

Copy link
Copy Markdown

❌ CI Job Failed — run-test-ios-26

View Build

@rickvdl rickvdl force-pushed the rickvdl/remote-config-manager-config-cache branch from 20ebc3d to 572b0f3 Compare June 25, 2026 07:10
@rickvdl rickvdl force-pushed the rickvdl/remote-config-container-validation branch from 560c8e3 to f87390e Compare June 25, 2026 07:11
@rickvdl rickvdl force-pushed the rickvdl/remote-config-manager-config-cache branch 4 times, most recently from f7ef32f to e8b227e Compare June 25, 2026 15:27
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.

2 participants