refactor(remote-config): inline blob store + extraction#3615
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
ab3e648 to
758b2b8
Compare
b5b7b6e to
2f56a66
Compare
758b2b8 to
fa63b72
Compare
2f56a66 to
b7eccb8
Compare
b7eccb8 to
9e3d8b1
Compare
fa63b72 to
5129003
Compare
9e3d8b1 to
b9c0e74
Compare
5129003 to
650f8d8
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 06-16-phase_2__v2_config_manifest_persistence_request_body_204_handling #3615 +/- ##
===========================================================================================================
- Coverage 80.30% 80.24% -0.07%
===========================================================================================================
Files 381 382 +1
Lines 15651 15711 +60
Branches 2181 2199 +18
===========================================================================================================
+ Hits 12569 12607 +38
- Misses 2214 2225 +11
- Partials 868 879 +11 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
b9c0e74 to
e40a0c5
Compare
650f8d8 to
2f49d86
Compare
e40a0c5 to
cbd6ee9
Compare
2f49d86 to
a6819b1
Compare
📸 Snapshot Test593 unchanged
🛸 Powered by Emerge Tools |
a6819b1 to
19f3cac
Compare
cbd6ee9 to
41560da
Compare
19f3cac to
ba88ac7
Compare
65f283e to
a475265
Compare
ba88ac7 to
6de1e60
Compare
a475265 to
54dc5f5
Compare
6de1e60 to
0498f0d
Compare
54dc5f5 to
ef7cc7f
Compare
0498f0d to
737f5be
Compare
0c7d740 to
4d924bb
Compare
248ddff to
f2c8284
Compare
9355718 to
6095724
Compare
f2c8284 to
05c4f49
Compare
05c4f49 to
e746901
Compare
322e020 to
7a27cb4
Compare
e746901 to
428e708
Compare
| val referencedRefs = response.prefetchBlobs.toSet() + mergedBlobRefs.values.flatten() | ||
| blobStore.retainOnly(referencedRefs) | ||
|
|
||
| diskCache.write( |
There was a problem hiding this comment.
FYI: On iOS we check if the remote config was persisted successfully before syncing the blobs to disk, that's probably a bit safer?
There was a problem hiding this comment.
Bubot had a valid concern about the iOS approach as well though.. RevenueCat/purchases-ios#7073 (comment)
Let's discuss :)
There was a problem hiding this comment.
Both good points thank you!!
|
|
||
| // Retain only blobs the current config still references: the prefetch set plus any topic blob ref. | ||
| val referencedRefs = response.prefetchBlobs.toSet() + mergedBlobRefs.values.flatten() | ||
| blobStore.retainOnly(referencedRefs) |
There was a problem hiding this comment.
On iOS I added some extra checks before writing the blobs to ensure they're still 'wanted' after applying the new response. Wrote down the logic in the PR description here
Basically I think the main differences is that iOS does not store all inlined blobs first, but will first check if they are wanted / needed.
Happy to discuss of course!
428e708 to
2afab8c
Compare
…edupe - Move GetRemoteConfig endpoint from /v2/config to /v1/config - Add app_user_id to the /v1/config request body (Backend.getRemoteConfig + RemoteConfigManager) - Dedupe overlapping RemoteConfigManager.refreshRemoteConfig calls with a single in-flight guard Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add RemoteConfigBlobStore, a content-addressed on-disk cache for remote-config blobs (one file per ref under RevenueCat/blobs/, keyed by the URL-safe base64 of the blob's truncated SHA-256). On a 200 sync, RemoteConfigManager now extracts inlined blob elements from the RCContainer, caches each only when its checksum verifies, evicts blobs no longer referenced by the manifest/topics, and records which prefetch blobs are held locally in manifest.prefetched_blobs so the server stops re-inlining them. Fetching missing prefetch blobs over the network is deferred to Phase 5 (needs the resolved blob source provider). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2afab8c to
8c2a0fe
Compare
e817f23 to
f070e8c
Compare

Checklist
purchases-iosand hybridsMotivation
Description