Open lanitochka17 opened 2 weeks ago
Triggered auto assignment to @mountiny (DeployBlockerCash
), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.
:wave: Friendly reminder that deploy blockers are time-sensitive β± issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
@mountiny FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
Not a blocker since this is behind beta
@blimpich I hope you dont mind I will assign you.
Are we not handling this optimistically? Feels like we should, but if not there should be some loader
Yeah this is a bug, we should be handling this optimistically.
Job added to Upwork: https://www.upwork.com/jobs/~01b996dd4f4317410f
Triggered auto assignment to Contributor-plus team member for initial proposal review - @getusha (External
)
Triggered auto assignment to @sonialiap (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
When adding Payment card, there is a slight delay before it shows
In the addSubscriptionPaymentCard function, we do not include card information in the optimistic data. Additionally, we do not update the successData when successful or the error in the failure data.
In the addSubscriptionPaymentCard function, we must incorporate optimisticData to mirror the backend's response. Furthermore, we should update the successData upon successful execution and the failureData in case of errors.
Additionally, we could display a skeleton while awaiting the response from the backend (By using addPaymentCardForm.loading from Onyx)
Navigation.goBack()
right after we call AddPaymentCard
API, that will close the payment form regardless the API is called successfully or not. const [formData] = useOnyx(ONYXKEYS.FORMS.ADD_PAYMENT_CARD_FORM);
const prevFormDataSetupComplete = usePrevious(!!formData?.setupComplete);
useEffect(() => {
if (prevFormDataSetupComplete || !formData?.setupComplete) {
return;
}
PaymentMethods.continueSetup();
}, [prevFormDataSetupComplete, formData?.setupComplete]);
if the API is called successfully, the setupComplete
is set to true
, based on that, we can auto close the form.
@getusha what do you think of the above proposals?
@sonialiap, @blimpich, @getusha Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
thanks for the proposal @dominictb
The solution you provided works and i see that's what we're doing in AddDebitCardPage
, could you expand more on your RCA and why the solution makes it work? thanks!
@getusha I updated my proposal to show how the solution works.
Current assignee @blimpich is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.
@blimpich do we want to handle this optimistically? i assume the backend will need to validate the card?
This is the behavior when adding a bank account
https://github.com/Expensify/App/assets/75031127/80b62c3f-9ddd-4392-86d9-99acb070e879
After applying @dominictb's solution the form will stay until it finishes loading, same as ^
Yes we should be handling this optimistically.
The proposal sounds good, though I would like to see more details on the implementation. We also need to change the offline UX pattern. it's currently blocking form. @cretadn22 could you update your proposal to include that too?
Yes we should be handling this optimistically.
@blimpich I suggest just showing a loading indicator on the submit button, that'll allow us to show an appropriate error message (if any) while in the form, and to keep the current offline pattern as I see the backend does some validation on the card details. That way makes the most sense to me. Please check the Add a Debit Card
page - settings/wallet/add-debit-card - i think it's similar to this page.
I tend to agree with @getusha here, Submitting the Add payment card
and Change payment currency
forms were both pattern C in the design doc as well because of these third party API calls. So when offline, the Submit
button on these forms is greyed out.
So I think we should remain on the form with a loading indicator on the submit button after they click it. If the API call is successful, the modal closes and the details should be updated on Subscription page (removing this feeling of there being a delay right now). If it fails, the modal doesn't close, and the errors are displayed in the form to fix using the standard form errors pattern.
@mountiny @shawnborton do ya'll agree? (Vit, I saw you asked about optimistic above)
That works for me!
Great stuff, so @getusha can we move this on for a proposal review from Ben and get the PR going? Thanks!
I think we're waiting on @cretadn22 to update their proposal with more details, so that it aligns with what we want here.
Yeah that sounds good if this should be pattern C
@blimpich I'm unable to add a payment card successfully. Could you please share mock card data that I can use for testing?
@blimpich we can proceed with @dominictb's proposal since we decided to stick with pattern C
@dominictb could you update your proposal to include https://github.com/Expensify/App/issues/45124 too? thanks!
Ah yes sorry my mistake. Sounds good @getusha π
π£ @dominictb π An offer has been automatically sent to your Upwork account for the Contributor role π Thanks for contributing to the Expensify app!
Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review π§βπ» Keep in mind: Code of Conduct | Contributing π
@dominictb please still update your proposal like @getusha said to include a fix for this issue, since they are basically the same issue π
Thank you @getusha for your suggestion on how to make this better, I agree this is the ideal solution to arrive at π
@blimpich Do we have the card or the mock data for testing?
I just created draft PR but I need the card to test and record screens in PR author checklist.
@dominictb DM'ed you with steps on how to do it, requires some special steps to use test data.
@blimpich Thanks. I am working on it.
@blimpich I tried to set up the environment as you mentioned. It works well. But when I sign in with the old account (not the first sign-in), there is no magic code sent to my email. Do you know what issue in here? I need to use old account because with new account, page https://dev.new.expensify.com:8082/settings/subscription is displayed as "Not here page".
@blimpich I encountered issue when changing billing payment: When the API is called successfully, the onyxData responded by BE is empty:
https://github.com/user-attachments/assets/c4c6df4f-25f3-4856-8427-4f742102aace
@dominictb sorry I forgot to mention that all magic codes when using a Expensify engineer's local backend will be 000000
. You won't get any emails unless I manually run a particular script on my backend.
For the missing onyxData, that appears to be a bug. Thank you for catching that! I will get that fixed, but it will probably take a few days or longer.
For now lets keep this issue/PR focused on adding a payment card, we'll use this issue to handle the change currency flow internally since this will require backend changes.
@dominictb do you think we can have the draft PR in review today?
PR https://github.com/Expensify/App/pull/45281 is ready to review, it will fix the bug #44904
Related to issue #45124, we should hold it until we fix the BE issue, and then I will raise the PR the fix its original issue using the solution.
cc @trjExpensify @blimpich
Nice one! Can you complete the video/screenshots in the OP of the PR linked above? Thanks!
@blimpich I found another BE bug when calling API AddPaymentCard
. When we already added the payment card 1, its findList['101'].accountData.additionalData.isBillingCard
is true
. Then I add the new payment card 2, BE only sets findList['102'].accountData.additionalData.isBillingCard
to true
but does not setfindList['101'].accountData.additionalData.isBillingCard
to false
unless we refresh the page.
@dominictb thank you for reporting the bug! I believe that has the same root cause as the first BE bug. Lets come back to that once the first BE bug is completed π
Reviewing
label has been removed, please complete the "BugZero Checklist".
The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.8-6 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2024-07-25. :confetti_ball:
For reference, here are some details about the assignees on this issue:
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
If you havenβt already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.4-6 Reproducible in staging?: Y Reproducible in production?: N If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Issue reported by: Applause - Internal Team
Issue found when executing PR https://github.com/Expensify/App/pull/44361
Action Performed:
Expected Result:
User expects that after saving the card data immediately loads and displays
Actual Result:
Several seconds go by before the card actually appears on the Sub page, leading the user to think the details did not save
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
https://github.com/Expensify/App/assets/78819774/7f761c91-7774-4285-bf1a-7ddd04c2c4d5
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @sonialiap