Repository navigation
Conversation
Paywalls can read device.customerInfo with camelCase keys, as the iOS SDK sends it. It's added only to the paywall page's variables, not to the device attributes, which also go to enrichment and audience filters. Each Play Store product variable gets isSubscribed, from the active Google Play purchases and the merged customer info. A purchase matches a product with the same subscription id, and the same base plan when both name one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CR7gAnqM9DKHUgsEkJsvWP
Its strict VariablesFactory mock has no answer for the new method. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CR7gAnqM9DKHUgsEkJsvWP
This comment has been minimized.
This comment has been minimized.
| // to enrichment and audience filters, so it isn't added to them. | ||
| templateDeviceDictionary = | ||
| templateDeviceDictionary + | ||
| ("customerInfo" to customerInfoManager.customerInfo.value.toTemplateParams()), |
There was a problem hiding this comment.
Warning
customerInfo reaches delegate logs with the full purchase history
F1 · Warning · security · PII-01
Adding the customer record here also adds it to TemplateLogic's plaintext templatesString log and PaywallMessageHandler's logged scripts. This exposes userId, transaction IDs and purchase history through SuperwallDelegate.handleLog, even when console logging is disabled (Logger.kt:70,92). The payload is not confined to the paywall page.
Remove or redact the template payload and encoded scripts from these logs before adding customer info; log only message type and counts.
🤖 Prompt to fix with an AI agent
In `superwall/src/main/java/com/superwall/sdk/dependencies/DependencyContainer.kt:1521`: `customerInfo` reaches delegate logs with the full purchase history.
Adding the customer record here also adds it to `TemplateLogic`'s plaintext `templatesString` log and `PaywallMessageHandler`'s logged scripts. This exposes `userId`, transaction IDs and purchase history through `SuperwallDelegate.handleLog`, even when console logging is disabled (`Logger.kt:70,92`). The payload is not confined to the paywall page.
Suggested fix: Remove or redact the template payload and encoded scripts from these logs before adding customer info; log only message type and counts.
Verify the problem exists at that location before changing it, and keep the fix to those lines.
There was a problem hiding this comment.
Fixed in 721f736. TemplateLogic and PaywallMessageHandler no longer log the templates or the scripts that carry them, only their size. That covers the "Template Logic" log, both "Posting Message" logs, the didLoadWebView script log and "Error Evaluating JS". TemplateLogPrivacyTest checks that a value from the user attributes and customer info reaches the page but no log passed to SuperwallDelegate.handleLog. It fails against the old logging.
Generated by Claude Code
This comment has been minimized.
This comment has been minimized.
…scribed The templates hold user attributes and now customer info, and logs reach SuperwallDelegate.handleLog, so TemplateLogic and PaywallMessageHandler log only their size. isSubscribed counted pending Google Play purchases, which aren't paid for. ReceiptManager now keeps the full ids of completed purchases only, internal rather than public. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CR7gAnqM9DKHUgsEkJsvWP
Maple review🟢 Confidence 10/10 · safe to merge. Targeted regression tests cover paid/pending receipts and template log redaction; tests were inspected, not executed. Adds customer info and per-product subscription state to paywall templates. The follow-up excludes pending purchases and removes template contents from delegate logs; the changed code is safe to merge.
|
Changes in this pull request
Brings Android in line with iOS on what paywalls can read about the user's purchases.
device.customerInfo: the merged customer info (subscriptions, non-subscription purchases, entitlements,userId) is added to the paywall page's template variables. Keys are camelCase, matching iOS. The SDK's shared encoder renames keys to snake_case, soCustomerInfo.toTemplateParams()encodes without that strategy. The existingtoParams()used for events is unchanged.isSubscribed: each Play Store product variable getsisSubscribed(e.g.products.primary.isSubscribed), set inTemplateLogic. The active ids come from completed Google Play purchases (new internalReceiptManager.completedPurchaseFullProductIds, full ids with base plan; pending purchases are left out) plus active subscriptions in the merged customer info. Unlike iOS, this also counts web checkout and purchase-controller subscriptions.sw-auto, or a purchase recorded without its base plan, matches any base plan of that subscription.TemplateLogicandPaywallMessageHandlerno longer log the templates or the scripts that carry them, only their size. They hold user attributes and now customer info, and logs reachSuperwallDelegate.handleLog.VariablesFactory.activePurchasedProductIds(), with a default empty implementation so existing fakes keep compiling. It's added tosuperwall.api.mainanddevelopwere both at 2.10.2), with a CHANGELOG entry.Checklist
:superwall:testDebugUnitTest, and theunit-testsCI job)instrumentation-testsCI jobs)TemplateLogicTest:isSubscribedmatching, camelCasecustomerInforeaching the page, empty placeholder.ReceiptManagerBasePlanTest: paid vs pending purchases.TemplateLogPrivacyTest: templates reach the page but no delegate log.)CHANGELOG.mdfor any breaking changes, enhancements, or bug fixes.ktlintin the main directory and fixed any issues. (Not run: ktlint couldn't be installed in the environment this was built in.)🤖 Generated with Claude Code
https://claude.ai/code/session_01CR7gAnqM9DKHUgsEkJsvWP