feat(paywalls): add web_view message value types (PWENG-98)#3662
feat(paywalls): add web_view message value types (PWENG-98)#3662alexrepty wants to merge 1 commit into
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. |
📸 Snapshot Test593 unchanged
🛸 Powered by Emerge Tools |
a3e9e1a to
0dffacc
Compare
3e62e49 to
2716386
Compare
0dffacc to
353f584
Compare
2716386 to
27793a8
Compare
353f584 to
df0ae01
Compare
81453b8 to
5505947
Compare
df0ae01 to
22be911
Compare
22be911 to
9cff885
Compare
74610d7 to
a42c874
Compare
9cff885 to
9349754
Compare
a42c874 to
7aceb78
Compare
9349754 to
428d1c2
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 7aceb78. Configure here.
| public constructor(value: kotlin.Float) : this(value.toDouble()) | ||
|
|
||
| override fun equals(other: Any?): kotlin.Boolean = other is Number && value == other.value | ||
| override fun hashCode(): Int = value.hashCode() |
There was a problem hiding this comment.
Number.equals/hashCode contract violation with IEEE 754 doubles
Low Severity
Number.equals uses IEEE 754 == (value == other.value) while hashCode delegates to Double.hashCode() which uses doubleToLongBits. This breaks the equals/hashCode contract: Number(0.0) and Number(-0.0) are equal but produce different hash codes, and Number(NaN) violates reflexivity (not equal to itself). Using value.toBits() == other.value.toBits() in equals would make both methods consistent.
Reviewed by Cursor Bugbot for commit 7aceb78. Configure here.
428d1c2 to
ef64abf
Compare
7aceb78 to
cf8d3d0
Compare
Adds a bidirectional JS<->native bridge for the Paywalls V2 `web_view` component: a document-start `window.RevenueCatWebView` shim, message parsing/validation (`WebViewMessageParser`, `WebViewMessageType`), the public `PaywallWebViewMessage` / `PaywallWebViewValue` / `PaywallWebViewMessageHandler` / `PaywallWebViewController` surface, and an SDK-managed variables provider (locale, color scheme, custom variables). Apps opt in via `PaywallOptions.setWebViewMessageHandler(...)`, threaded through `PaywallState` / `OfferingToStateMapper`. Regenerates ui/revenuecatui/api.txt for the new public API. Recommended labels: pr:feat, pr:RevenueCatUI, feat:Paywalls_V2
ef64abf to
c25018a
Compare
cf8d3d0 to
9cad6e3
Compare



Checklist
purchases-iosand hybridsMotivation
The
web_viewbidirectional-messaging bridge needs a JSON-compatible value type to represent message payloads in a type-safe, public-API-friendly way.Part of PWENG-98.
Description
PaywallWebViewValuesealed type (String/Number/Boolean/Object/Array/Null) plus JSON conversion helpers.PaywallWebViewValueTest.iOS parity: mirrors
purchases-ios(web-view-bridge-wiring).Stack (merge bottom-up): schema → rendering → CSP → value types → message model → variables provider → JS bridge → wiring.
Note
Low Risk
Additive public API and internal helpers only; no changes to purchase, auth, or existing paywall runtime behavior.
Overview
Introduces
PaywallWebViewValue, a new public JSON-shaped type for Paywalls V2web_viewmessage payloads, ahead of the JS bridge stack (PWENG-98).The type is an abstract class with nested variants (
String,Number,Boolean,Object,Array,Null)—same pattern asCustomVariableValuefor stable public API.api.txtdocuments the new surface.Internal helpers add
fromJson(with a nesting depth cap and rejection of non-JSON types) and outbound serialization viatoJsonRepresentation/toJsonObject(whole numbers emitted as integers). No message envelope, parser, or WebView wiring in this PR—data layer only.PaywallWebViewValueTestcovers primitives, nested structures, depth limits, and round-trip JSON.Reviewed by Cursor Bugbot for commit cf8d3d0. Bugbot is set up for automated code reviews on this repo. Configure here.