Skip to content

feat(remote-config): update request and response models according to spec#7022

Merged
rickvdl merged 4 commits into
mainfrom
rickvdl/remote-config-api-endpoint-v2
Jun 24, 2026
Merged

feat(remote-config): update request and response models according to spec#7022
rickvdl merged 4 commits into
mainfrom
rickvdl/remote-config-api-endpoint-v2

Conversation

@rickvdl

@rickvdl rickvdl commented Jun 16, 2026

Copy link
Copy Markdown
Member

Part of the remote config stack, builds on #7037.

Backend source-of-truth context: https://github.com/RevenueCat/khepri/pull/21676.

Android parity reference: RevenueCat/purchases-android#3610.

Updates the API models to match the new backend spec and Android implementation. Contains the minimal modeling required to encode/decode the config object.

Note that no clean APIs were introduced for genericly decoding business models into concrete types, this will be done in a follow up PR that introduces the RemoteConfigManager.


Note

Medium Risk
Changes core remote-config wire models and request coalescing keys that future sync logic will depend on, but the HTTP path still returns RCContainer? and no RemoteConfigManager consumes RemoteConfiguration yet.

Overview
Replaces the old RemoteConfigResponse shape (top-level api_sources / blob_sources and a nested manifest object) with RemoteConfiguration, matching the new /v2/config contract: domain, subdomains, opaque manifest, active_topics, prefetch_blobs, and topics that carry only changed topic bodies via flexible ConfigItem entries (blob_ref, prefetch, plus arbitrary inline content).

RemoteConfigRequest is no longer an empty POST body—it now sends domain (default "app"), optional manifest, and prefetched_blobs when non-empty. GetRemoteConfigOperation / RemoteConfigAPI thread that request through and key in-flight request coalescing on domain, manifest, and sorted prefetched blobs so differing sync states do not share one network call.

Decoding tests are renamed and expanded for the new models; backend remote-config tests assert the new JSON body and coalescing rules.

Reviewed by Cursor Bugbot for commit cd935bb. Bugbot is set up for automated code reviews on this repo. Configure here.

@rickvdl

rickvdl commented Jun 16, 2026

Copy link
Copy Markdown
Member Author

@RCGitBot please test

@emerge-tools

emerge-tools Bot commented Jun 16, 2026

Copy link
Copy Markdown

4 builds decreased size

Name Version Download Change Install Change Approval
RevenueCat
com.revenuecat.PaywallsTester
1.0 (1) 18.9 MB ⬆️ 3.3 kB (0.02%) 68.3 MB ⬇️ 42.3 kB (-0.06%) N/A
BinarySizeTest
com.revenuecat.binary-size-test.local-source
1.0 (1) 4.4 MB ⬇️ 842 B (-0.02%) 13.1 MB ⬇️ 7.1 kB (-0.05%) N/A
BinarySizeTest
com.revenuecat.binary-size-test.cocoapods
1.0 (1) 6.6 MB ⬇️ 4.0 kB (-0.06%) 28.9 MB ⬇️ 40.7 kB (-0.14%) ⏳ Needs approval
BinarySizeTest
com.revenuecat.binary-size-test.spm
1.0 (1) 4.5 MB ⬇️ 763 B (-0.02%) 11.4 MB ⬇️ 3.4 kB (-0.03%) N/A

RevenueCat 1.0 (1)
com.revenuecat.PaywallsTester

⚖️ Compare build
⏱️ Analyze build performance

Total install size change: ⬇️ 42.3 kB (-0.06%)
Total download size change: ⬆️ 3.3 kB (0.02%)

Largest size changes

Item Install Size Change
DYLD.String Table ⬇️ -22.8 kB
🗑 RevenueCat.RemoteConfigResponse ⬇️ -3.9 kB
RevenueCat.RemoteConfigAPI.RemoteConfigAPI ⬆️ 1.5 kB
Code Signature ⬇️ -936 B
DYLD.Exports ⬇️ -624 B
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: ⬇️ 7.1 kB (-0.05%)
Total download size change: ⬇️ 842 B (-0.02%)

Largest size changes

Item Install Size Change
🗑 RevenueCat.RemoteConfigResponse ⬇️ -16.4 kB
DYLD.String Table ⬇️ -3.3 kB
📝 RevenueCat.RemoteConfiguration.__derived_struct_equals ⬆️ 1.7 kB
📝 RevenueCat.RemoteConfiguration.init(from) ⬆️ 1.4 kB
📝 RevenueCat.RemoteConfiguration.ConfigItem.init(from) ⬆️ 1.3 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: ⬇️ 40.7 kB (-0.14%)
Total download size change: ⬇️ 4.0 kB (-0.06%)

Largest size changes

Item Install Size Change
DYLD.String Table ⬇️ -26.1 kB
🗑 RevenueCat.RemoteConfigResponse ⬇️ -16.4 kB
📝 RevenueCat.RemoteConfiguration.init(from) ⬆️ 1.4 kB
📝 RevenueCat.RemoteConfiguration.ConfigItem.init(from) ⬆️ 1.3 kB
Code Signature ⬇️ -1.2 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: ⬇️ 3.4 kB (-0.03%)
Total download size change: ⬇️ 763 B (-0.02%)

Largest size changes

Item Install Size Change
🗑 RevenueCat.RemoteConfigResponse ⬇️ -16.4 kB
📝 RevenueCat.RemoteConfiguration.__derived_struct_equals ⬆️ 1.7 kB
📝 RevenueCat.RemoteConfiguration.init(from) ⬆️ 1.4 kB
📝 RevenueCat.RemoteConfiguration.ConfigItem.init(from) ⬆️ 1.3 kB
📝 RevenueCat.RemoteConfiguration.ConfigItem.encode(to) ⬆️ 912 B
View Treemap

Image of diff


🛸 Powered by Emerge Tools

@rickvdl rickvdl force-pushed the rickvdl/remote-config-api-endpoint-v2 branch from 85655eb to d94efa3 Compare June 18, 2026 15:41
@rickvdl rickvdl changed the base branch from main to rickvdl/remote-config-request June 18, 2026 15:42
@rickvdl rickvdl changed the title Update remote config API endpoint to v2 contract feat(remote-config): add v2 config request and response models Jun 18, 2026
@rickvdl rickvdl changed the title feat(remote-config): add v2 config request and response models feat(remote-config): update request and response models according to spec Jun 18, 2026
@rickvdl rickvdl force-pushed the rickvdl/remote-config-api-endpoint-v2 branch 6 times, most recently from 7353dc0 to 32e22eb Compare June 19, 2026 05:13
@@ -10,27 +10,32 @@ import Foundation
final class GetRemoteConfigOperation: CacheableNetworkOperation {

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.

Will rename this in a follow up PR to SyncRemoteConfigOperation where the actual syncing happens

@rickvdl rickvdl force-pushed the rickvdl/remote-config-api-endpoint-v2 branch 3 times, most recently from cf2e497 to b540cab Compare June 19, 2026 07:41
struct Topics: Equatable {

/// Changed topic bodies only: topic name to item name to config item.
let entries: [String: [String: ConfigItem]]

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.

Will be adding some more generic helpers for decoding concrete types from the topics / config items. So did not spend too much time in making the 'api' nice for getting the data.

This will be done in the follow up PR working on the remote config manager.

}

init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: DynamicCodingKey.self)

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.

@rickvdl rickvdl marked this pull request as ready for review June 19, 2026 07:47
@rickvdl rickvdl requested a review from a team as a code owner June 19, 2026 07:47

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

Just a question but looks great!!

Comment thread Sources/Networking/Operations/GetRemoteConfigOperation.swift Outdated
@rickvdl

rickvdl commented Jun 19, 2026

Copy link
Copy Markdown
Member Author

@RCGitBot please test

@rickvdl rickvdl force-pushed the rickvdl/remote-config-request branch from 4e4ae0d to 60efa0c Compare June 19, 2026 10:43
Base automatically changed from rickvdl/remote-config-request to main June 19, 2026 12:38
@rickvdl rickvdl force-pushed the rickvdl/remote-config-api-endpoint-v2 branch 2 times, most recently from 9434b2e to b980d5f Compare June 22, 2026 09:18

@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 2 potential issues.

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 b980d5f. Configure here.

Comment thread Sources/Networking/Operations/GetRemoteConfigOperation.swift
Comment thread Sources/Networking/Operations/GetRemoteConfigOperation.swift
@rickvdl rickvdl force-pushed the rickvdl/remote-config-api-endpoint-v2 branch from b980d5f to 969f3ef Compare June 22, 2026 09:34
@rickvdl

rickvdl commented Jun 22, 2026

Copy link
Copy Markdown
Member Author

@RCGitBot please test

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

One comment but I think it's not a blocker either.

Comment thread Sources/Networking/Responses/RemoteConfiguration.swift Outdated
@rickvdl

rickvdl commented Jun 24, 2026

Copy link
Copy Markdown
Member Author

@RCGitBot please test

@rickvdl rickvdl force-pushed the rickvdl/remote-config-api-endpoint-v2 branch from f829337 to cd935bb Compare June 24, 2026 07:46
@rickvdl

rickvdl commented Jun 24, 2026

Copy link
Copy Markdown
Member Author

@RCGitBot please test

@rickvdl rickvdl merged commit 9b9e7fc into main Jun 24, 2026
43 of 44 checks passed
@rickvdl rickvdl deleted the rickvdl/remote-config-api-endpoint-v2 branch June 24, 2026 08:37
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