New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PAY-2080: Retry pledge after error with PaymentSheet #1710
Merged
Merged
Conversation
This file contains 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
- reload payment methods if the setpIntent finishes with error
- Create backing was called alongside updateBacking, separate the button filtering by pledgeReason - Fixed tests
- added tests
Codecov Report
@@ Coverage Diff @@
## master #1710 +/- ##
============================================
+ Coverage 78.62% 78.64% +0.02%
- Complexity 1950 1952 +2
============================================
Files 359 359
Lines 18013 18031 +18
Branches 2146 2146
============================================
+ Hits 14162 14180 +18
Misses 2603 2603
Partials 1248 1248
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
leighdouglas
approved these changes
Nov 29, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great! Lgtm!
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.
📲 What
Several points in the PR:
Fatal Exception: java.lang.IllegalArgumentException: Invalid Setup Intent client secret: ...
discovered during QA party for Checkout flows with PaymentSheet. Firebase reportRefined a bit the user facing error messages for this point with, instead of presenting the generic "Something went wrong" message, now the Stripe error localized message is displayed to the user.
TransactionTooLargeException
for certain projects when triggering 3DS flow after adding payment method usingPaymentSheet
Firebase report🛠 How
This section is gonna described mainly those steps to identify the root cause behind #2. In order to debug an identify the
TransactionTooLargeException
a key tool has been https://github.com/guardian/toolargetool, is a debug tool so no trace of it on the PR.First taking a closer look into the logcat trace of the error, on the warnings you can see :
This warning trace indicates fragments presented and their size, as you can see two of the are taking up much more memory than they should, and are considerably bigger that the rest one fragment with
[size=143456]
and[size=431628]
those hexadecimals identifiers can be traced back to the KS fragments by filtering mode the onCreate logs (the screenshot is just to showcase how to filter in logcat, it does not match the with the execution of the previous exception)At this point the guilty intents have been identified in your trace and those two were
BackingAddOnsFragment
andPledgeFragment
, the intents for launching those two fragments were taking more than 100KB each ...Now if you add
toolargetool
to your build, and have breakpoints on those functions starting theBackingAddOnsFragment
andPledgeFragment
you will be able to evaluate in real time the size of the intent by using toolargetool methodbundleBreakdown
BEFORE: 140KB was the size for the the
BackingAddOnsFragment
bundleNOW: 3.6 is the size for the
BackingAddOnsFragment
bundleThe solution has been reducing the project fields to only those mandatory to be able to operate the user journey from the moment a reward is picked, please take a look into
Project.reduce()
extension function to have more details about which ones are those mandatory fields.Also taken the chance to review the RX subscriptions and tied those who weren't before to the lifecycle in all the user journey since the point a reward is picked, and reduced to only the
project.slug
the bundles forProjectActivity
,UpdateActivity
.👀 See
| Before 🐛 |
before.mp4
| After 🦋 |
after.mp4
| | |
📋 QA
For QA #1 :
4000 0000 0000 3220
, once the 3DS flow is presented fail it, you should see a message like the screenshot below, and the payment method not visible on the UI. After that you should be able to pledge or add a new payment method as usual.For QA #2 :
4000 0000 0000 3220
. You should be able to complete the 3DS challenge without any crash as shown on the AFTER videoStory 📖
NTV-2080