Skip to content
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

[HOLD for payment 2023-02-18] [$2000] Payment method actions doesn’t get dismissed when payment method deleted from different device #14524

Closed
2 of 6 tasks
kavimuru opened this issue Jan 24, 2023 · 48 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@kavimuru
Copy link

kavimuru commented Jan 24, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. Go to payment methods page in 2 devices
  2. On first device click on the payment method so that ‘Delete’ or ‘Make default payment’ popup shows up
  3. Now delete the payment method from the second device

Expected Result

As payment method is removed, the popup should also dismiss

Actual Result

The payment method is removed but the popup is not removed and even allowing to enter password.

Workaround:

unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.2.58-3
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:

Screen.Recording.2023-01-24.at.11.03.12.PM.mov
Recording.77.mp4

Expensify/Expensify Issue URL:
Issue reported by: @abdulrahuman5196
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1674584214326729

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01721c4a575a5223ab
  • Upwork Job ID: 1618785375281623040
  • Last Price Increase: 2023-02-03
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jan 24, 2023
@melvin-bot melvin-bot bot locked and limited conversation to collaborators Jan 24, 2023
@sophiepintoraetz
Copy link
Contributor

sophiepintoraetz commented Jan 26, 2023

Bug0 Triage Checklist

Note: see this SO for more information.

  • The "bug" is actually a bug
  • The bug is not a duplicate report of an existing GH.
    • If it is, close the GH and add any novel details to the original GH instead
  • The bug is reproducible, following the reproduction steps.
    • If the GH doesn’t have steps to reliably reproduce the bug and you figure it out, then please add them.
    • If you’re unable to reproduce the bug, add the Needs reproduction label.
    • Comment on the issue outlining the steps you took to try to reproduce the bug, your results and tag the issue reporter and the Applause QA member who created the issue. Ask them to clarify reproduction steps and/or to check the reproduction steps again. Close issue.
  • The GH template is filled out as fully as possible
    • The GH body and title are clear (ie. could an external contributor understand it and work on it?)
  • The GH was created by an Expensify employee or a QA tester
  • If the bug is an OldDot issue, you should decide whether it is widespread enough to justify fixing or it is better to wait for reunification. If it’s better to wait, close the GH & provide this justification
  • If there's a link to Slack, check the discussion to see if we decided not to fix it
  • Decide if the GH should be resolved by an External contributor or Internal engineer, add the appropriate label

@sophiepintoraetz
Copy link
Contributor

I was able to reproduce this - the pop up did not disappear for me.
image

@PauloGasparSv
Copy link
Contributor

Will test what happens if you try deleting or setting the default password on that state to make sure this is something we want to fix or not and maybe start a discussion on #expensify-open-source

@PauloGasparSv
Copy link
Contributor

Tested here and I do think we need to fix this!
If we attempt to delete an account that is already deleted, an non-dismissible error appears and an empty bank account appears in the list.

image

Marking this as External.

@PauloGasparSv PauloGasparSv added the External Added to denote the issue can be worked on by a contributor label Jan 27, 2023
@melvin-bot melvin-bot bot unlocked this conversation Jan 27, 2023
@melvin-bot melvin-bot bot changed the title Payment method actions doesn’t get dismissed when payment method deleted from different device [$1000] Payment method actions doesn’t get dismissed when payment method deleted from different device Jan 27, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jan 27, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01721c4a575a5223ab

@melvin-bot
Copy link

melvin-bot bot commented Jan 27, 2023

Current assignee @sophiepintoraetz is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Jan 27, 2023

Triggered auto assignment to Contributor-plus team member for initial proposal review - @0xmiroslav (External)

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 27, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jan 27, 2023

Current assignee @PauloGasparSv is eligible for the External assigner, not assigning anyone new.

@abdulrahuman5196
Copy link
Contributor

abdulrahuman5196 commented Jan 27, 2023

I was the reporter and made initial proposal as part of slack report itself - https://expensify.slack.com/archives/C049HHMV9SM/p1674648521989299?thread_ts=1674584214.326729&cid=C049HHMV9SM
Proposal
Root Cause
We are not updating the local states to dismiss the modals when the payment method is deleted in another device and we receive pusher notification.
Solution 1

index df20970bf2..56791d56a8 100644
--- a/src/pages/settings/Payments/PaymentsPage/BasePaymentsPage.js
+++ b/src/pages/settings/Payments/PaymentsPage/BasePaymentsPage.js
@@ -86,6 +86,18 @@ class BasePaymentsPage extends React.Component {
         } else {
             this.debounceSetShouldShowLoadingSpinner();
         }
+        if (this.state.shouldShowDefaultDeleteMenu || this.state.shouldShowPasswordPrompt) {
+            if ((this.props.bankAccountList !== prevProps.bankAccountList && !_.find(this.props.bankAccountList, paymentMethod => paymentMethod.methodID === this.state.methodID))
+            || (this.props.cardList !== prevProps.cardList && !_.find(this.props.cardList, paymentMethod => paymentMethod.methodID === this.state.methodID))
+            || (this.props.payPalMeData !== prevProps.payPalMeData && prevProps.payPalMeData.methodID === this.state.methodID)) {
+                if (this.state.shouldShowDefaultDeleteMenu) {
+                    this.hideDefaultDeleteMenu();
+                }
+                if (this.state.shouldShowPasswordPrompt) {
+                    this.hidePasswordPrompt();
+                }
+            }
+        }
 
         // previously online OR currently offline, skip fetch
         if (!prevProps.network.isOffline || this.props.network.isOffline) {
@@ -518,6 +530,9 @@ export default compose(
         cardList: {
             key: ONYXKEYS.CARD_LIST,
         },
+        payPalMeData: {
+            key: ONYXKEYS.PAYPAL,
+        },
         walletTerms: {
             key: ONYXKEYS.WALLET_TERMS,
         },

Solution 2

--- a/src/pages/settings/Payments/PaymentsPage/BasePaymentsPage.js
+++ b/src/pages/settings/Payments/PaymentsPage/BasePaymentsPage.js
@@ -86,6 +86,21 @@ class BasePaymentsPage extends React.Component {
         } else {
             this.debounceSetShouldShowLoadingSpinner();
         }
+        if (this.state.shouldShowDefaultDeleteMenu || this.state.shouldShowPasswordPrompt) {
+            if ((this.props.bankAccountList !== prevProps.bankAccountList
+                || this.props.cardList !== prevProps.cardList
+                || this.props.payPalMeData !== prevProps.payPalMeData)
+                && !_.find(PaymentUtils.formatPaymentMethods(this.props.bankAccountList, this.props.cardList, this.props.payPalMeData),
+                    paymentMethod => paymentMethod.methodID === this.state.methodID)) {
+                if (this.state.shouldShowDefaultDeleteMenu) {
+                    this.hideDefaultDeleteMenu();
+                }
+                if (this.state.shouldShowPasswordPrompt) {
+                    this.hidePasswordPrompt();
+                }
+            }
+        }
 
         // previously online OR currently offline, skip fetch
         if (!prevProps.network.isOffline || this.props.network.isOffline) {
@@ -518,6 +533,9 @@ export default compose(
         cardList: {
             key: ONYXKEYS.CARD_LIST,
         },
+        payPalMeData: {
+            key: ONYXKEYS.PAYPAL,
+        },
         walletTerms: {
             key: ONYXKEYS.WALLET_TERMS,
         },

Add-ons we can do

@ebergolla
Copy link

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!

Action Performed:

1. Go to payment methods page in 2 devices

2. On first device click on the payment method so that ‘Delete’ or ‘Make default payment’ popup shows up

3. Now delete the payment method from the second device

Expected Result

As payment method is removed, the popup should also dismiss

Actual Result

The payment method is removed but the popup is not removed and even allowing to enter password.

Workaround:

unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

* [ ]  Android / native

* [ ]  Android / Chrome

* [x]  iOS / native

* [ ]  iOS / Safari

* [x]  MacOS / Chrome / Safari

* [ ]  MacOS / Desktop

Version Number: 1.2.58-3 Reproducible in staging?: y Reproducible in production?: y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos:
Screen.Recording.2023-01-24.at.11.03.12.PM.mov
Recording.77.mp4

Expensify/Expensify Issue URL: Issue reported by: @abdulrahuman5196 Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1674584214326729

View all open jobs on GitHub
Upwork Automation - Do Not Edit

Proposal

I would add the necessary code to read when prop cardList changes in component BasePaymentPage, if this prop changes I would check if the payment method(selected to delete or set as default) still exists, if not I would change the state "shouldShowDefaultDeleteMenu" in BasePaymentPage component to false that way it would hide the "popup".

Thanks,
Ernesto

@s77rt

This comment was marked as duplicate.

@melvin-bot
Copy link

melvin-bot bot commented Jan 27, 2023

Looks like something related to react-navigation may have been mentioned in this issue discussion.

As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our DeprecatedCustomActions.js files should not be accepted.

Feel free to drop a note in #expensify-open-source with any questions.

@abdulrahuman5196

This comment was marked as outdated.

@abdulrahuman5196

This comment was marked as outdated.

@s77rt

This comment was marked as off-topic.

@s77rt

This comment was marked as off-topic.

@abdulrahuman5196

This comment was marked as outdated.

@DavidGOD228
Copy link

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!

Action Performed:

  1. Go to payment methods page in 2 devices
  2. On first device click on the payment method so that ‘Delete’ or ‘Make default payment’ popup shows up
  3. Now delete the payment method from the second device

Expected Result

As payment method is removed, the popup should also dismiss

Actual Result

The payment method is removed but the popup is not removed and even allowing to enter password.

Workaround:

unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.2.58-3 Reproducible in staging?: y Reproducible in production?: y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos:

Screen.Recording.2023-01-24.at.11.03.12.PM.mov
Recording.77.mp4
Expensify/Expensify Issue URL: Issue reported by: @abdulrahuman5196 Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1674584214326729

View all open jobs on GitHub

Upwork Automation - Do Not Edit

PROPOSAL:
As I see final solution should look like.

  • We have an event that updates the list of accounts after deletion, we run a listener that will wait for the deletion
  • After the deletion event works, check the following conditions:
  1. We have an open modal window
  2. A modal window is open for the account that was deleted
    If the condition is true, we remove the buttons in the modal window and insert the appropriate text there

In the code it'll be:
This listener should be in BasePaymentPage.js and it should trigger this.hideDefaultDeleteMenu(); and show text alert to user.
Best,
David

@s77rt

This comment was marked as off-topic.

@melvin-bot melvin-bot bot removed the Overdue label Feb 6, 2023
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 6, 2023
@melvin-bot
Copy link

melvin-bot bot commented Feb 6, 2023

📣 @abdulrahuman5196 You have been assigned to this job by @PauloGasparSv!
Please apply to this job in Upwork 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 📖

@abdulrahuman5196
Copy link
Contributor

@PauloGasparSv @0xmiroslav
PR is ready for this issue - #14869
Should be a Quick PR as the change is same as the commit diff reviewed

Quick Tip: I usually have the test account logged-in on a incognito tab to quickly add test payment methods as soon as i delete. This helps to quickly verify the fix in multiple platforms.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Feb 11, 2023
@melvin-bot melvin-bot bot changed the title [$2000] Payment method actions doesn’t get dismissed when payment method deleted from different device [HOLD for payment 2023-02-18] [$2000] Payment method actions doesn’t get dismissed when payment method deleted from different device Feb 11, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Feb 11, 2023
@MelvinBot
Copy link

Reviewing label has been removed, please complete the "BugZero Checklist".

@MelvinBot
Copy link

MelvinBot commented Feb 11, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.2.69-2 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-02-18. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@MelvinBot
Copy link

MelvinBot commented Feb 11, 2023

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:

@abdulrahuman5196
Copy link
Contributor

Regression Test

  1. Login to same account in 2 different devices(primary and secondary)
  2. Go to payment methods page on primary device
  3. On primary device click on a payment method so that ‘Delete’ or ‘Make default payment’ popup shows up.
  4. Now go to payment methods page on secondary device
  5. Delete the payment method from the secondary device which was selected on the primary device.
  6. Now on primary device the popup should have been dismissed and the payment method should have been removed from the list.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Feb 17, 2023
@abdulrahuman5196
Copy link
Contributor

@sophiepintoraetz Gentle remainder. This issue has passed 7 days regression timeframe. I have applied for the upwork job as well.

@sophiepintoraetz
Copy link
Contributor

sophiepintoraetz commented Feb 19, 2023

@abdulrahuman5196 - please don't bump the GH for payment unless there's been a significant time lapse (I'm talking weeks). We have our own method for keeping track of payments (see the daily label vs weekly) and considering the 18th is a weekend for me, there wasn't going to be an opportunity until today.

@sophiepintoraetz
Copy link
Contributor

sophiepintoraetz commented Feb 20, 2023

Actually, don't mind me - I miscalculated the bonus @abdulrahuman5196!

@0xmiroslav - your payment is $3000, I believe - are you able to apply for the job?

Job hire list for me

@abdulrahuman5196
Copy link
Contributor

@sophiepintoraetz Accepted the upwork offer.

@0xmiros
Copy link
Contributor

0xmiros commented Feb 20, 2023

@0xmiroslav - your payment is $3000, I believe - are you able to apply for the job?

@sophiepintoraetz Applied for the job

@sophiepintoraetz sophiepintoraetz added Weekly KSv2 and removed Daily KSv2 labels Feb 20, 2023
@sophiepintoraetz
Copy link
Contributor

Moving back to weekly now that payment/hiring has been issued.

@sophiepintoraetz
Copy link
Contributor

QA here

@0xmiroslav and @PauloGasparSv - please can you complete the steps in this comment here and close the issue once you've done so?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
None yet
Development

No branches or pull requests

9 participants