feat(paywalls): enable web_view component (8)#3787
Conversation
1b9f1c4 to
b0b0c1a
Compare
b0b0c1a to
93e4d6e
Compare
1ff0aa7 to
2db5faa
Compare
This stack of pull requests is managed by Graphite. Learn more about stacking. |
4c350ab to
bff0cea
Compare
2db5faa to
b7dee83
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3787 +/- ##
==========================================
+ Coverage 80.43% 80.44% +0.01%
==========================================
Files 408 408
Lines 16890 16900 +10
Branches 2467 2469 +2
==========================================
+ Hits 13586 13596 +10
Misses 2342 2342
Partials 962 962 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
a77cdfd to
34f2544
Compare
4203d56 to
d6db6c3
Compare
34f2544 to
eed8e96
Compare
📸 Snapshot Test621 unchanged
🛸 Powered by Emerge Tools |
8c11c73 to
e168877
Compare
ee57f61 to
87ec64a
Compare
87ec64a to
59b9d72
Compare
e168877 to
c331b16
Compare
a0926f5 to
3f17314
Compare
658facd to
89c8a8e
Compare
0709292 to
12112d7
Compare
89c8a8e to
6d0ed10
Compare
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 12112d7. Configure here.
12112d7 to
b7222d1
Compare
6d0ed10 to
59ad8c2
Compare
b7222d1 to
d3730e4
Compare
59ad8c2 to
05743b4
Compare
d3730e4 to
c324750
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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 ec6fa0b. Configure here.
Avoids the pre-first-frame play-button placeholder Android WebView paints over an autoplay <video>. Hides video[autoplay] until it emits 'playing', with a 5s fallback reveal so a video that never plays can't stay hidden.
Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Jacob Rakidzich <Jacob@JacobZivanDesign.com>
When a web_view component declares a protocol_version this SDK does not implement, treat it like an unrecognized component and render the author's `fallback` (throwing if none), instead of rendering a web view whose bridge handshake would just be rejected at runtime. Mirrors purchases-js and the generic unknown-component fallback path. Backend already rejects != 1 at publish time; this is client-side defense in depth.


Checklist
Motivation
Final part of the
web_viewseries (splitting #3757). This is the activation PR: the only change that alters runtime behavior, so reverting it alone turns theweb_viewfeature off. All downstack parts (schema, transport envelope, navigation policy, JS bridge, Compose view, kotlinx transport refactor, WebView profile isolation) are merged; this now sits standalone onmain.Description
"web_view"in thePaywallComponentdeserializerResult.Success(null)) withcreateWebViewComponentStyleWebViewComponent.SUPPORTED_PROTOCOL_VERSIONas the single source of truth for the supported version; the runtime handshake in:ui:revenuecatuiderives from it, so the decode-time gate and the handshake cannot disagreeprotocol_versionrenders the componentfallback(same path as an unknown component), gated on the raw value before decode for forward compatibilityWebViewComponentTestsdecode and version-gate cases,StyleFactoryTests, and e2eWebViewOfferingToStateTest(a config withweb_viewproduces aWebViewComponentStylein the paywall state)Submodule
No
web_viewpreview fixtures on the resources submodule; pointer left untouched.Verified locally:
WebViewComponentTests,StyleFactoryTests,webview.*(incl. e2e),detektAll.Labels:
pr:feat,pr:RevenueCatUI,feat:Paywalls_V2After merge
Close #3757 as superseded (do not merge it).
Note
Medium Risk
Enables hosted WebView content in paywalls (new attack/rendering surface), though unsupported protocol versions and missing fallbacks are gated; misconfigured paywalls without fallbacks can still fail deserialization.
Overview
Turns on Paywalls V2
web_viewend-to-end: configs withtype: "web_view"now deserialize throughPaywallComponentand map toWebViewComponentStyleinstead of being dropped by the StyleFactory stub.Decoding:
"web_view"is registered inPaywallComponentSerializer.protocol_versionis checked on the raw JSON before decoding the body; only version1(WebViewComponent.SUPPORTED_PROTOCOL_VERSION) becomes aWebViewComponent. Missing, malformed, or unsupported versions use the samefallbackpath as unknown components (including forward-incompatible future payloads), with a shareddecodeFallbackhelper.Runtime alignment:
WebViewEnvelope.DEFAULT_PROTOCOL_VERSIONnow derives fromWebViewComponent.SUPPORTED_PROTOCOL_VERSIONso the schema gate and JS bridge handshake stay in sync.Tests: Polymorphic decode and version-gate cases in
WebViewComponentTests, StyleFactory coverage, andWebViewOfferingToStateTest(config → paywall state includesWebViewComponentStyle).Reviewed by Cursor Bugbot for commit 346e2c8. Bugbot is set up for automated code reviews on this repo. Configure here.