feat(remote-config): add RC Container format V1 + parser#7030
Merged
Conversation
1d18890 to
baf939b
Compare
b094183 to
1283e04
Compare
6f5f707 to
b88c073
Compare
Member
Author
|
@RCGitBot please test |
tonidero
reviewed
Jun 18, 2026
tonidero
left a comment
Contributor
There was a problem hiding this comment.
This is looking really great! I didn't see any differences with the Android implementation. At your suggestion, I added some tests to test against an actual binary file which we might want to also add here
8cf5949 to
b34b7ec
Compare
Member
Author
|
@RCGitBot please test |
Member
Author
Did the same and ran the tests against the Android binary files as well, no diff so byte-for-byte identical generation and all tests passed on them as well. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Initial implementation of the
RCContainerbinary format for the remote-config API.Implements the documented format while trying to be as consistent as possible with RevenueCat/purchases-android#3534
Contains the following components:
RCContainer- The parsed data structure itselfRCContainer.Element- Each element in the data structure, where element 0 is always the config blob itself, and subsequent elements will be (optionally) inlined blobsRCContainer.Parser- The container parser, handles format validation and zero-copy parsing of the binary data into theRCContainerformat.Note
Low Risk
New isolated parsing code with broad tests and no production API integration in this diff; main risk is future wire-format mismatches if server and client diverge.
Overview
Adds RC Container v1 parsing under
Sources/Networkingfor the upcoming remote-config binary response format, aligned with the documented wire layout and Android behavior.RCContainervalidates rawDataand exposes header flags, the first config element, and optional inlined blobs incontentElementskeyed by 32-character base64url blob refs (duplicate checksums keep the last entry).RCContainer.Parserwalks the buffer with typedFormatErrorcases (magic/version, truncation, padding, checksum mismatch, missing config).RCContainer.Elementindexes into the retained container withwithPayloadBytes/withChecksumBytesso payloads are not copied per element.Unit coverage includes in-memory builders, malformed-input rejection, zero-copy address checks, frozen
.binbackwards-compatibility fixtures, and a README for regenerating fixtures viaGENERATE_RC_CONTAINER_FIXTURES=1. Xcode project entries wire the new sources and tests; this PR does not yet hook the parser into live remote-config HTTP handling.Reviewed by Cursor Bugbot for commit b34b7ec. Bugbot is set up for automated code reviews on this repo. Configure here.