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

[$1000] Payment method dropdown option resets everytime we click on amount and go back #17805

Closed
6 tasks
kavimuru opened this issue Apr 21, 2023 · 32 comments
Closed
6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Weekly KSv2

Comments

@kavimuru
Copy link

kavimuru commented Apr 21, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Open the app on any device
  2. Click on plus and click on send money
  3. Select USD as currency, add any amount and click on continue
  4. Change payment method from 'Pay with PayPal' to 'I will settle elsewhere'
  5. Click on amount, click back and observe the payment method selection has changed back to 'Pay with PayPal'

Expected Result:

App should not change payment method back to default on just visit of amount page

Actual Result:

App changes payment method back to default on visit of amount page and coming back

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

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.3.3-2
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: Any additional supporting documentation

payment.method.changes.to.default.on.amount.page.visit.mp4
Recording.308.mp4

Expensify/Expensify Issue URL:
Issue reported by: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1682071567004949

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01a42d8836ae8668cf
  • Upwork Job ID: 1650557626009874432
  • Last Price Increase: 2023-06-27
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 21, 2023
@MelvinBot
Copy link

Triggered auto assignment to @anmurali (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@MelvinBot
Copy link

MelvinBot commented Apr 21, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@melvin-bot melvin-bot bot added the Overdue label Apr 24, 2023
@anmurali
Copy link

Can reproduce

@melvin-bot melvin-bot bot removed the Overdue label Apr 24, 2023
@anmurali anmurali added External Added to denote the issue can be worked on by a contributor Overdue labels Apr 24, 2023
@melvin-bot melvin-bot bot changed the title Payment method dropdown option resets everytime we click on amount and go back [$1000] Payment method dropdown option resets everytime we click on amount and go back Apr 24, 2023
@MelvinBot
Copy link

Job added to Upwork: https://www.upwork.com/jobs/~01a42d8836ae8668cf

@MelvinBot
Copy link

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

@MelvinBot
Copy link

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

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

Triggered auto assignment to @dangrous (External), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@dangrous
Copy link
Contributor

I'm fairly certain this is going to have the same solution as:
#17637
and
#17710
@parasharrajat let me know if you agree and if so we can probably close this out?

@melvin-bot melvin-bot bot removed the Overdue label Apr 24, 2023
@akinwale
Copy link
Contributor

akinwale commented Apr 24, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

The payment method on the Send Money page keeps resetting after switching between the amount screen and the payment screen.

What is the root cause of that problem?

The SettlementButton component contains a ButtonWithMenu component which is recreated every time the user navigates away and back to the page.

What changes do you think we should make in order to solve the problem?

Add a state variable that stores the currently selected payment option to the MoneyRequestModal and pass a handler as a prop down through the children components up to the ButtonWithMenu component which updates the state for the modal. Also pass this state variable as a prop to the ButtonWithMenu component to set the selected option.

Quick summary of changes.

  1. In the MoneyRequestModal component
const [selectedPaymentMethodIndex, setSelectedPaymentMethodIndex] = useState(0);

Add the following props to MoneyConfirmPage.

onSelectPaymentMethod={setSelectedPaymentMethodIndex}
selectedPaymentMethod={selectedPaymentMethodIndex}
  1. Add the same pair of props to MoneyRequestConfirmationList in the MoneyConfirmPage component.
onSelectPaymentMethod={props.onSelectPaymentMethod}
selectedPaymentMethod={props.selectedPaymentMethod}
  1. Add the same pair to SettlementButton in the MoneyRequestConfirmationList component.
onSelectPaymentMethod={this.props.onSelectPaymentMethod}
selectedPaymentMethod={this.props.selectedPaymentMethod}
  1. Add the same pair to ButtonWithMenu in the SettlementButton component.
onSelectPaymentMethod={this.props.onSelectPaymentMethod}
selectedPaymentMethod={this.props.selectedPaymentMethod}
  1. Update the ButtonWithMenu component.
const selectedItem = this.props.options[this.props.selectedPaymentMethod];
...
onSelected: () => {
    if (_.isFunction(this.props.onSelectPaymentMethod)) {
        this.props.onSelectPaymentMethod(index);
    }
},

What alternative solutions did you explore? (Optional)

None.

@Christinadobrzyn
Copy link
Contributor

I think #17866 is a dupe of this issue

@parasharrajat or @dangrous could you confirm in the #17866 issue?

@parasharrajat
Copy link
Member

parasharrajat commented Apr 24, 2023

It does not sound duplicate to me. We are talking about the button state between navigations here. @Christinadobrzyn @dangrous

@MelvinBot
Copy link

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.

@parasharrajat
Copy link
Member

Do you agree on #17805 (comment) @dangrous and @Christinadobrzyn?

@dangrous
Copy link
Contributor

Yeah I think it's separate? Not 100% sure but better to err on the side of separate rather than risk not fixing one of these.

@aimane-chnaif
Copy link
Contributor

I suggest to hold this for #17662 since money request pages are being refactored in that PR.

@dangrous
Copy link
Contributor

dangrous commented May 1, 2023

Yeah I think that's right - I'll put this on hold! Keeping $$$ the same for now since we figured that out before the week was up, but we can revisit as needed in the future.

@dangrous dangrous changed the title [$1000] Payment method dropdown option resets everytime we click on amount and go back [HOLD #17662][$1000] Payment method dropdown option resets everytime we click on amount and go back May 1, 2023
@melvin-bot melvin-bot bot added the Overdue label May 3, 2023
@dangrous
Copy link
Contributor

dangrous commented May 3, 2023

Holding still

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels May 3, 2023
@anmurali
Copy link

anmurali commented May 8, 2023

Still on hold

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels May 8, 2023
@dangrous
Copy link
Contributor

Holding

@melvin-bot melvin-bot bot removed the Overdue label May 10, 2023
@dangrous
Copy link
Contributor

Gonna put this on weekly while it's on hold

@dangrous dangrous added Weekly KSv2 and removed Daily KSv2 labels May 12, 2023
@melvin-bot melvin-bot bot added the Overdue label May 22, 2023
@dangrous
Copy link
Contributor

Still holding

@melvin-bot melvin-bot bot removed the Overdue label May 22, 2023
@melvin-bot melvin-bot bot added the Overdue label May 30, 2023
@dangrous
Copy link
Contributor

still holding

@melvin-bot melvin-bot bot removed the Overdue label May 30, 2023
@dangrous
Copy link
Contributor

dangrous commented Jun 6, 2023

still on hold

@dangrous
Copy link
Contributor

HODL

@dangrous
Copy link
Contributor

still waiting

@dangrous
Copy link
Contributor

PR fixing #17662 is on staging! We can probably move ahead with retesting and (if necessary) updating proposals

@akinwale
Copy link
Contributor

Looks like the bug has been fixed as I can no longer reproduce it on the latest main.

@dangrous dangrous changed the title [HOLD #17662][$1000] Payment method dropdown option resets everytime we click on amount and go back [$1000] Payment method dropdown option resets everytime we click on amount and go back Jun 26, 2023
@dangrous
Copy link
Contributor

Confirmed that I don't see this happening on main anymore. @anmurali or @parasharrajat can you give it one last test to be sure, and if so we can just close this (after handling any necessary payments, I think it would just be bug reporting?)

@melvin-bot
Copy link

melvin-bot bot commented Jun 27, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@anmurali
Copy link

Confirmed! Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Weekly KSv2
Projects
None yet
Development

No branches or pull requests

8 participants