Skip to content

feat(paywalls): add web_view wire envelope (2/7)#7228

Merged
ajpallares merged 21 commits into
mainfrom
webview/2-envelope
Jul 21, 2026
Merged

feat(paywalls): add web_view wire envelope (2/7)#7228
ajpallares merged 21 commits into
mainfrom
webview/2-envelope

Conversation

@JZDesign

@JZDesign JZDesign commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Checklist

  • If applicable, unit tests
  • If applicable, create follow-up issues for purchases-android and hybrids

Motivation

Part 2 of 7 splitting #7183; inert until Part 7. Message size and nesting policy remains server-owned so limits can change without requiring an SDK release.

Description

Adds the internal WebViewEnvelope encoding, decoding, validation, and tests. The client accepts the canonical JSON string wire format and validates its structure and channel identity without imposing fixed byte or nesting thresholds. No runtime paywall behavior change until Part 7.

PR Plan

PWENG-99

Part PR Branch Base
1/7 #7227 webview/1-public-api main
2/7 #7228 webview/2-envelope main
3/7 #7229 webview/3-isolation-navigation main
4/7 #7230 webview/4-schema main
5/7 #7231 webview/5-session webview/deps-123 (retarget after I1–I3)
6/7 #7232 webview/6-view webview/deps-45 (retarget after I4–I5)
7/7 #7233 webview/7-activate webview/deps-6 (retarget after I6)
Open in Web Open in Cursor 

cursoragent and others added 2 commits July 15, 2026 20:18
Add PaywallWebViewMessage/Value/Controller/Action types and API baselines.
Controller post APIs are no-ops until the session PR wires WebKit.

Co-authored-by: Jacob Rakidzich <Jacob@JacobZivanDesign.com>
Add WebViewEnvelope encode/decode and input hardening tests.
Inert until Part 7; builds on the public API from Part 1.

Co-authored-by: Jacob Rakidzich <Jacob@JacobZivanDesign.com>
@emerge-tools

emerge-tools Bot commented Jul 15, 2026

Copy link
Copy Markdown

1 build increased size, 3 builds had no size change

Name Version Download Change Install Change Approval
RevenueCat
com.revenuecat.PaywallsTester
1.0 (1) 19.2 MB ⬆️ 13.1 kB (0.07%) 69.5 MB ⬆️ 55.5 kB (0.08%) N/A
BinarySizeTest
com.revenuecat.binary-size-test.local-source
1.0 (1) 4.5 MB ⬆️ 62 B 13.4 MB - N/A
BinarySizeTest
com.revenuecat.binary-size-test.cocoapods
1.0 (1) 6.7 MB ⬆️ 2 B 29.4 MB - N/A
BinarySizeTest
com.revenuecat.binary-size-test.spm
1.0 (1) 4.6 MB ⬇️ 92 B 11.7 MB - N/A

RevenueCat 1.0 (1)
com.revenuecat.PaywallsTester

⚖️ Compare build
⏱️ Analyze build performance

Total install size change: ⬆️ 55.5 kB (0.08%)
Total download size change: ⬆️ 13.1 kB (0.07%)

Largest size changes

Item Install Size Change
DYLD.String Table ⬆️ 15.0 kB
DYLD.Exports ⬆️ 2.4 kB
Code Signature ⬆️ 1.1 kB
📝 RevenueCatUI.WebViewEnvelope.Envelope.CodingKeys.Swift Metadata ⬆️ 505 B
Other ⬆️ 36.6 kB
View Treemap

Image of diff

BinarySizeTest 1.0 (1)
com.revenuecat.binary-size-test.local-source

No changes to report

BinarySizeTest 1.0 (1)
com.revenuecat.binary-size-test.cocoapods

No changes to report

BinarySizeTest 1.0 (1)
com.revenuecat.binary-size-test.spm

No changes to report


🛸 Powered by Emerge Tools

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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 f7f5d16. Configure here.

Comment thread RevenueCatUI/Templates/V2/Components/WebView/WebViewEnvelope.swift
cursoragent and others added 4 commits July 16, 2026 20:01
Co-authored-by: Jacob Rakidzich <Jacob@JacobZivanDesign.com>
Co-authored-by: Jacob Rakidzich <Jacob@JacobZivanDesign.com>
Co-authored-by: Jacob Rakidzich <Jacob@JacobZivanDesign.com>
Comment thread RevenueCatUI/Templates/V2/Components/WebView/WebViewEnvelope.swift Outdated
Comment thread RevenueCatUI/Templates/V2/Components/WebView/WebViewEnvelope.swift Outdated
Comment thread Tests/RevenueCatUITests/PaywallsV2/WebViewEnvelopeTests.swift
Comment thread RevenueCatUI/Templates/V2/Components/WebView/WebViewEnvelope.swift Outdated
Comment thread RevenueCatUI/Templates/V2/Components/WebView/WebViewEnvelope.swift Outdated
Co-authored-by: Jacob Rakidzich <Jacob@JacobZivanDesign.com>
@cursor cursor Bot changed the title feat(paywalls): web_view wire envelope + JSON hardening (2/7) feat(paywalls): add web_view wire envelope (2/7) Jul 17, 2026
cursoragent and others added 3 commits July 17, 2026 14:20
Co-authored-by: Jacob Rakidzich <Jacob@JacobZivanDesign.com>
Co-authored-by: Jacob Rakidzich <Jacob@JacobZivanDesign.com>
Co-authored-by: Jacob Rakidzich <Jacob@JacobZivanDesign.com>
@JZDesign
JZDesign requested a review from ajpallares July 17, 2026 15:00
JZDesign and others added 2 commits July 17, 2026 11:09
The bridge no longer forwards messages to an app-provided handler, so the
message, action, controller, and environment types are removed. Only the
JSON value type remains.

Co-authored-by: Cursor <cursoragent@cursor.com>
Base automatically changed from webview/1-public-api to main July 20, 2026 09:27
ajpallares and others added 5 commits July 20, 2026 11:48
Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	RevenueCat.xcodeproj/project.pbxproj
…er and tests

Carries over the edits that didn't land in PR #1: file rename to match its
sole `PaywallWebViewValue` type, copyright header, and added test coverage for
`arrayValue`/nested accessors and top-level scalar/empty-container round-trips.

Co-authored-by: Cursor <cursoragent@cursor.com>
… doc

Adds tests asserting the encoded frame uses snake_case wire keys and omits nil
fields, decodes a full message frame with a rich payload, and rejects invalid
protocol_version / non-string fields / non-object payload / non-object JSON.

Co-authored-by: Cursor <cursoragent@cursor.com>
Defer the reserved-key set to Part 5 where its only consumer lives, and
make the test JSON helper throwing to remove the file-wide force_try
disable.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ajpallares
ajpallares requested a review from AlvaroBrey July 20, 2026 13:50
@ajpallares ajpallares added pr:other and removed pr:feat A new feature labels Jul 20, 2026
Comment thread RevenueCatUI/Templates/V2/Components/WebView/WebViewEnvelope.swift Outdated
Comment thread RevenueCatUI/Templates/V2/Components/WebView/WebViewEnvelope.swift Outdated
Keep only the `resize`/`fit` message types (matching Android) and drop the
`rc:*` leftovers from a previous API design. Remove `receiveScript`/
`receiveFunction` from the envelope data model; they're bridge concerns and
will live in WebViewSession in Part 5 where the sole consumer exists.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ajpallares ajpallares self-assigned this Jul 21, 2026
@ajpallares
ajpallares merged commit 9d9255c into main Jul 21, 2026
45 checks passed
@ajpallares
ajpallares deleted the webview/2-envelope branch July 21, 2026 07:23
ajpallares added a commit that referenced this pull request Jul 21, 2026
Retarget Part 5 onto main now that Parts 1-3 (#7227, #7228, #7229) are merged.

Resolve conflicts by keeping main's canonical Part 1-3 files (PaywallWebViewValue,
WebViewEnvelope, WebViewOriginPolicy and their tests) and dropping stale
deps-123 artifacts (PaywallWebViewAPI.swift, WebViewIsolation.swift and its test,
plus the now-unused content_rules_failed log string). Part 5's own additions
(WebViewSession + tests, log strings) are preserved.

Co-authored-by: Cursor <cursoragent@cursor.com>
vegaro added a commit that referenced this pull request Jul 23, 2026
A merge in #7197 reintroduced duplicate PBXBuildFile/PBXFileReference/PBXGroup
entries pointing at PaywallWebViewAPI.swift, which was renamed to
PaywallWebViewValue.swift in #7228. The duplicate file reference UUID caused
Xcode to resolve to the stale (nonexistent) path, breaking the
create_xcframework archive build used by release-checks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants