Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes in this pull request
Checklist
CHANGELOG.mdfor any breaking changes, enhancements, or bug fixes.ktlintin the main directory and fixed any issues.Greptile Summary
This PR threads
CustomerInfothrough the paywall product-loading and presentation pipelines.PaywallRequestManagertakes a point-in-time snapshot viacurrentCustomerInfo()to determine Stripe/Paddle free-trial eligibility (blocking trials whensubscriptionscontains any prior same-store entry), whilePaywallViewsubscribes to acustomerInfoFlow()StateFlowfor live updates that propagate intoPaywallInfo.eventParams()ascustomer_*analytics params. The implementation is clean, tests cover cross-store non-blocking and per-store blocking cases, and lifecycle cleanup of the newcustomerInfoListeneris correctly paired with the existingstopStateListener().Confidence Score: 5/5
Safe to merge — all changes are additive and well-tested with no breaking surface.
No P0 or P1 issues found. The dual-path design (snapshot for product loading, live flow for view updates) is intentional and correctly implemented. Tests cover the key eligibility branches, and the new factory methods are properly mocked in both unit and instrumented tests.
No files require special attention.
Important Files Changed
Sequence Diagram
sequenceDiagram participant PRM as PaywallRequestManager participant PL as PaywallLogic participant CI as CustomerInfo participant PV as PaywallView participant CIF as CustomerInfoFactory (StateFlow) PRM->>PRM: getProducts(paywall, request) PRM->>CI: factory.currentCustomerInfo() CI-->>PRM: CustomerInfo (snapshot) PRM->>PL: getVariablesAndFreeTrial(..., customerInfo) note over PL: Stripe/Paddle: check hasEverSubscribedOn(store)<br/>Play/AppStore: use storeProduct.hasFreeTrial PL-->>PRM: ProductProcessingOutcome (isFreeTrialAvailable) PRM->>PRM: paywall.isFreeTrialAvailable = outcome.isFreeTrialAvailable PV->>CIF: factory.customerInfoFlow().collect { ... } CIF-->>PV: CustomerInfo updates (live) PV->>PV: controller.updateState(SetCustomerInfo(it)) note over PV: PaywallViewState.info computed property<br/>returns paywall.getInfo().copy(customerInfo = customerInfo) PV->>PV: PaywallInfo.eventParams() includes customer_* paramsReviews (1): Last reviewed commit: "Add free trial check based on previous s..." | Re-trigger Greptile