Conversation
Customer pw info
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
2.7.12
Enhancements
Fixes
Checklist
CHANGELOG.mdfor any breaking changes, enhancements, or bug fixes.ktlintin the main directory and fixed any issues.Greptile Summary
This PR adds
CustomerInfotoPaywallInfoand tracked events, adds Stripe/Paddle intro-offer eligibility checking, and fixes Samsung bottom-sheet dismiss animation by deferring state changes viapost {}.responseLoadCompleteTimealways equals start time: the secondaryPaywallInfoconstructor passesresponseLoadStartTimeto theresponseLoadCompleteTimefield, sopaywall_response_load_complete_timein analytics is always wrong.super.finish()in dismiss animation:val e = (animatedValue as Int) / colorFromperforms integer division on signed ARGB ints; the value changes sign at ~36% of the animation, causingfinish()to fire far too early and cutting the background fade short — partially defeating the Samsung fix.webViewLoadStartTimein the same constructor, a copy-paste bug causing incorrect shimmer timing in events.Confidence Score: 3/5
Not safe to merge as-is — two P1 bugs affect analytics data correctness and the very animation fix this PR delivers.
Two P1 findings: the
responseLoadCompleteTimecopy-paste bug causes permanently wrong analytics timestamps, and the prematuresuper.finish()call breaks the dismiss animation that this PR explicitly sets out to fix. Both are in actively modified code.PaywallInfo.kt(timestamp bugs),SuperwallPaywallActivity.kt(ARGB arithmetic in dismiss animation).Important Files Changed
customerInfotoPaywallInfo; secondary constructor has two copy-paste bugs:responseLoadCompleteTimeusesresponseLoadStartTime, and both shimmer timestamps usewebViewLoadStartTime.content.post {}for bottom-sheet state changes; background fade animation has a prematuresuper.finish()call due to incorrect integer arithmetic on packed ARGB values.isWebTrialAvailableandhasEverHadEntitlement;ELIGIBLEoverride ignorestrialDays, which may be intentional but is undocumented.toParams()serialisation for analytics;isPlaceholderinternal flag leaks into serialised output asis_placeholderkey.customerInfotoPaywallViewStateand computesPaywallInfowith.copy(customerInfo = customerInfo), cleanly injecting customer context at the view layer.Sequence Diagram
sequenceDiagram participant PRM as PaywallRequestManager participant PL as PaywallLogic participant CI as CustomerInfo participant PVS as PaywallViewState participant PI as PaywallInfo PRM->>PRM: factory.currentCustomerInfo() PRM->>PL: getVariablesAndFreeTrial(customerInfo, introOfferEligibility) PL->>PL: computeHasFreeTrial() PL->>PL: isWebTrialAvailable() [Stripe/Paddle] PL->>CI: hasEverHadEntitlement() CI-->>PL: Boolean PL-->>PRM: ProductProcessingOutcome PRM->>PI: paywall.getInfo(event) customerInfo=empty PI-->>PRM: PaywallInfo (no customerInfo yet) Note over PVS: View layer injects customerInfo PVS->>PI: paywall.getInfo(event).copy(customerInfo=customerInfo) PI-->>PVS: PaywallInfo (with customerInfo) PVS->>PI: eventParams() includes customer_info mapComments Outside Diff (3)
superwall/src/main/java/com/superwall/sdk/paywall/presentation/PaywallInfo.kt, line 122-125 (link)responseLoadCompleteTimecopiesresponseLoadStartTimeThe secondary constructor passes
responseLoadStartTimeto theresponseLoadCompleteTimefield, so both fields always contain the same timestamp. TheresponseLoadCompleteTimeparameter from the constructor is silently ignored here, meaning the analytics event parameterpaywall_response_load_complete_timewill always equal the start time.Prompt To Fix With AI
superwall/src/main/java/com/superwall/sdk/paywall/view/SuperwallPaywallActivity.kt, line 690-696 (link)finish()due to ARGB sign-change in integer divisioncolorFromisColor.argb(200, 0, 0, 0)=0xC8000000, which is negative as a signed 32-bit int. During the animation,ArgbEvaluatorproduces values that are negative when alpha > 127 and positive when alpha ≤ 127. Once alpha drops below 128 (at ≈36% of the animation),animatedValuebecomes positive ande = positive / negative = -1, which is< 0.1, sosuper.finish()is called after only ~36% of the 300 ms fade — the background is still clearly visible. This undermines the Samsung dismiss fix added in the same function.The intent is likely to check that the animation is nearly done before finishing:
addUpdateListener { animator -> val animatedColor = animator.animatedValue as Int window.setBackgroundDrawable(ColorDrawable(animatedColor)) val animatedAlpha = android.graphics.Color.alpha(animatedColor) if (animatedAlpha < (0.1f * android.graphics.Color.alpha(colorFrom)).toInt()) { super.finish() } }Prompt To Fix With AI
superwall/src/main/java/com/superwall/sdk/paywall/presentation/PaywallInfo.kt, line 172-178 (link)webViewLoadStartTimeBoth
shimmerLoadStartTimeandshimmerLoadCompleteTimeare set from thewebViewLoadStartTimeparameter instead of their own parameters. TheshimmerLoadStartTimeandshimmerLoadCompleteTimeconstructor arguments are silently ignored, causing incorrect shimmer timing in analytics events.Prompt To Fix With AI
Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "Merge pull request #397 from superwall/i..." | Re-trigger Greptile