refactor(remote-config): manifest persistence, request body handling#3612
Conversation
83d0b57 to
b8c0117
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3612 +/- ##
==========================================
+ Coverage 80.29% 80.30% +0.01%
==========================================
Files 379 381 +2
Lines 15568 15651 +83
Branches 2172 2181 +9
==========================================
+ Hits 12500 12569 +69
- Misses 2204 2214 +10
- Partials 864 868 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
b8c0117 to
d112e22
Compare
fb82861 to
dd4061d
Compare
d112e22 to
b5b7b6e
Compare
dd4061d to
e4eb551
Compare
e4eb551 to
f50eab9
Compare
2f56a66 to
b7eccb8
Compare
f50eab9 to
1468860
Compare
b7eccb8 to
9e3d8b1
Compare
a8a7b1f to
db36f20
Compare
b9c0e74 to
e40a0c5
Compare
6a666b9 to
cea3fa5
Compare
e40a0c5 to
cbd6ee9
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ 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 4d924bb. Configure here.
|
Moving back to draft since I'm still missing some things sorry for the noise! |
|
This PR might need to change to make the manifest a client-abstracted format instead of what we do right now, but we can iterate on this after I would say. |
rickvdl
left a comment
There was a problem hiding this comment.
Looks good overall! The implementation will probably slightly change after the modeled backend changes, so happy to do another pass after that
9355718 to
6095724
Compare
7c34516 to
448f2ba
Compare
836f875 to
322e020
Compare
Make the remote-config sync stateful:
- Backend.getRemoteConfig now accepts a ConfigManifest, replays it in full as
the {"manifest": {...}} request body (serialized via kotlinx so the model's
@SerialName fields are the single source of truth), and surfaces 204 No
Content as a null RCContainer (no-change) distinct from a 200 binary response.
- Add a ConfigurationResponse.parse(ByteBuffer) overload.
- New RemoteConfigDiskCache persists the manifest + resolved topic bodies to
noBackupFilesDir/RevenueCat/remote_config.json (atomic write, lenient read).
- New RemoteConfigManager replays the persisted manifest, and on 200 persists
the server manifest plus merged/pruned topic bodies; on 204/error keeps cache.
Not wired into the SDK lifecycle yet (Phase 7). Blob extraction (Phase 3) and
topic-handler dispatch (Phase 4) are intentionally not done here.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
322e020 to
7a27cb4
Compare
rickvdl
left a comment
There was a problem hiding this comment.
Looking good! Two non-blocking questions


Description
This PR is part of the stack to support the new Remote configuration endpoint.
In this PR, we add support to cache the Manifest in the remote config response, and then post it back in the request so the backend can decide what needs updating.
Note
Medium Risk
Changes the remote-config network contract and introduces on-disk state that affects what the server is told on each sync; behavior is mostly internal with safe fallbacks on parse/read failures, but incorrect persistence could cause extra full fetches or stale topic bookkeeping until later phases wire blob handling.
Overview
Adds incremental
/v2/configsync by persisting an opaque server manifest and replaying it on the next request so the backend can return 204 when nothing changed.Backend.getRemoteConfignow POSTsdomain, optionalmanifest(omitted on first sync), andprefetched_blobsinstead of an empty body.RemoteConfigDiskCacheatomically stores sync bookkeeping (manifest, active topics, prefetch list, per-topic blob refs) undernoBackupFilesDir; corrupt or legacy on-disk format reads asnulland forces a fresh sync.RemoteConfigManagerloads that state, drives the backend call, leaves the cache alone on 204/errors/bad payloads, and on 200 merges changed topic blob refs while pruning inactive topics.RemoteConfiguration.parse(ByteBuffer)duplicates the buffer so RC container views stay untouched.Reviewed by Cursor Bugbot for commit fd4d12c. Bugbot is set up for automated code reviews on this repo. Configure here.