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 2024-07-26] [$250] Send invoice - "Choose a payment method" disappears after returning from Pay elsewhere page #44830

Closed
6 tasks done
izarutskaya opened this issue Jul 4, 2024 · 39 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@izarutskaya
Copy link

izarutskaya commented Jul 4, 2024

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-0
Reproducible in staging?: Y
Reproducible in production?: Y
Found when validating PR : #43036
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team

Action Performed:

  1. Go to staging.new.expensify.com
  2. [User A] Send an invoice to user B.
  3. [User B] Go to invoice chat.
  4. [User B] Click Pay button.
  5. [User B] Click Pay as individual or Pay as business.
  6. [User B] Click on the back button.

Expected Result:

"Choose a payment method below" in the payment method selection page will persist.

Actual Result:

"Choose a payment method below" in the payment method selection page disappears.

Workaround:

Unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6532611_1720055363822.20240704_090314.1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ace2c2d5df911f17
  • Upwork Job ID: 1809200291724480759
  • Last Price Increase: 2024-07-05
  • Automatic offers:
    • cretadn22 | Contributor | 103046339
Issue OwnerCurrent Issue Owner: @sonialiap
@izarutskaya izarutskaya added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 4, 2024
Copy link

melvin-bot bot commented Jul 4, 2024

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.

@izarutskaya
Copy link
Author

We think this issue might be related to the #vip-bills.

@daledah
Copy link
Contributor

daledah commented Jul 4, 2024

Proposal

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

"Choose a payment method below" in the payment method selection page disappears.

What is the root cause of that problem?

We don't use setState when click back button in

enteredSubMenuIndexes.splice(-1);

so state enteredSubMenuIndexes is not updated and popover isn't rendered again

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

We should create a function renderHeader() and it'll update header everytime enteredSubMenuIndexes changes

    const renderHeader = () => {
        if(!headerText || enteredSubMenuIndexes.length > 0) {
            return;
        }
        return <Text style={[styles.createMenuHeaderText, styles.ph5, styles.pv3]}>{headerText}</Text>
    }

What alternative solutions did you explore? (Optional)

Using setState in this case

setEnteredSubMenuIndexes((prevState) => prevState.splice(-1)) 

@cretadn22
Copy link
Contributor

Proposal

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

"Choose a payment method" disappears after returning from Pay elsewhere page

What is the root cause of that problem?

We update enteredSubMenuIndexes state directly

enteredSubMenuIndexes.splice(-1);

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

Need to utilize setState to adjust the state value

enteredSubMenuIndexes.splice(-1);

setEnteredSubMenuIndexes((prevState) => prevState.slice(0, -1)) 

What alternative solutions did you explore? (Optional)

@sonialiap sonialiap added the External Added to denote the issue can be worked on by a contributor label Jul 5, 2024
Copy link

melvin-bot bot commented Jul 5, 2024

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

@melvin-bot melvin-bot bot changed the title Send invoice - "Choose a payment method" disappears after returning from Pay elsewhere page [$250] Send invoice - "Choose a payment method" disappears after returning from Pay elsewhere page Jul 5, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 5, 2024
Copy link

melvin-bot bot commented Jul 5, 2024

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

@Abdelrahman286
Copy link

it would be better if you explain with voice

Copy link

melvin-bot bot commented Jul 6, 2024

📣 @Abdelrahman286! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@mollfpr
Copy link
Contributor

mollfpr commented Jul 6, 2024

@cretadn22 What's the advantage of your solution to use slice instead of splice?

@cretadn22
Copy link
Contributor

@mollfpr The bug occurs because we modify the state directly instead of using setState

enteredSubMenuIndexes.splice(-1);

This logic will delete the final element from enteredSubMenuIndexes

8

splice(-1) will remove the last element in the original array and return the last element

@mollfpr
Copy link
Contributor

mollfpr commented Jul 8, 2024

Thanks @cretadn22 it seems to make sense to use slice instead because it returned the copied array.

The proposal from @cretadn22 looks good to me!

🎀 👀 🎀 C+ reviewed!

Copy link

melvin-bot bot commented Jul 8, 2024

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

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 9, 2024
Copy link

melvin-bot bot commented Jul 9, 2024

📣 @cretadn22 🎉 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 📖

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Jul 10, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jul 19, 2024
@mollfpr
Copy link
Contributor

mollfpr commented Jul 24, 2024

@sonialiap @techievivek I'm not sure how we should handle this case, but I think we should compensate @daledah for the solution used to solve this issue, and because the selected solution got reverted.

@mollfpr
Copy link
Contributor

mollfpr commented Jul 24, 2024

@cretadn22 I don't know why you laughing at my comment 🥲

This idea was mine first. Please check the history of their proposal

Also, I'm not sure which part you mean is your idea. What I'm pointing out is this snippet from your PR.

    const renderHeaderText = () => {
        if (!headerText || enteredSubMenuIndexes.length !== 0) {
            return;
        }
        return <Text style={[styles.createMenuHeaderText, styles.ph5, styles.pv3]}>{headerText}</Text>;
    };

Here's the history from the @daledah proposal.

Screenshot 2024-07-24 at 19 15 11

@cretadn22
Copy link
Contributor

cretadn22 commented Jul 24, 2024

@mollfpr Sorry, I misunderstand your mean. I didn't expect this coincidence 😄

@cretadn22
Copy link
Contributor

I don't know why you laughing at my comment 🥲

I don't mean anything, don't mind

@mollfpr
Copy link
Contributor

mollfpr commented Jul 24, 2024

I don't mean anything, don't mind

@cretadn22 No worries, I'm just joking with you 😄

@techievivek
Copy link
Contributor

@mollfpr so are we going with another PR here since the original changes got reverted? Or did we implement the solution somewhere else?

@cretadn22
Copy link
Contributor

@techievivek My PR fixed this issue. We don't need to create a new PR

@cretadn22
Copy link
Contributor

cretadn22 commented Jul 25, 2024

While working on the pull request, I encountered #45178 (comment) that caused the native app to crash. I dedicated considerable effort to investigating and fixing this issue in order to proceed with the pull request by using #45178 (comment).

The fixing for additional bug also resolve this issue 😄 , (detail here)

@techievivek
Copy link
Contributor

#45178 fixed this issue. We don't need to create a new PR

Aaah, I see now, @mollfpr referred to a different PR by a different contributor.

@techievivek
Copy link
Contributor

I think we can partially compensate @daledah(since their solution was used in the fix) and @cretadn22(they created the PR and helped fix another bug). I will let @sonialiap take a look into it. Thanks.

@mollfpr
Copy link
Contributor

mollfpr commented Jul 26, 2024

[@mollfpr] The PR that introduced the bug has been identified. Link to the PR:
[@mollfpr] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:

No offending PR was found.

[@mollfpr] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:

The regression step should be good!

[@mollfpr] Determine if we should create a regression test for this bug.
[@mollfpr] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.

  1. [User A] Send an invoice to user B.
  2. [User B] Go to invoice chat.
  3. [User B] Click the Pay button.
  4. [User B] Click Pay as individual
  5. [User B] Click on the back button
  6. Verify "Choose a payment method below" in the payment method selection page will persist
  7. 👍 or 👎

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Jul 26, 2024
@techievivek
Copy link
Contributor

Looks good to me, @sonialiap can we please get this added to testRail, thanks.

Copy link

melvin-bot bot commented Jul 29, 2024

@sonialiap, @mollfpr, @techievivek, @cretadn22 Whoops! This issue is 2 days overdue. Let's get this updated quick!

@JmillsExpensify
Copy link

@sonialiap please add a payment summary when you get a chance.

@sonialiap
Copy link
Contributor

sonialiap commented Jul 30, 2024

Since it seems like there was extra work put into this, I'm increasing the base price to $500

Payment summary:

  • @daledah $250 for the proposal - offer sent in Upwork - paid in Upwork ✔️
  • @cretadn22 $500 for the fix - paid in Upwork ✔️
  • @mollfpr $500 for the c+ - please request in ND

Does this sound fair to everyone?

@melvin-bot melvin-bot bot removed the Overdue label Jul 30, 2024
@JmillsExpensify
Copy link

$500 approved for @mollfpr

@cretadn22
Copy link
Contributor

@JmillsExpensify @sonialiap Could you please approve my offer?

@melvin-bot melvin-bot bot added the Overdue label Aug 1, 2024
@daledah
Copy link
Contributor

daledah commented Aug 2, 2024

@sonialiap Sounds good to me thanks, could you send the offer to my UW profile here? https://www.upwork.com/freelancers/~0138d999529f34d33f

@sonialiap
Copy link
Contributor

@daledah thanks for the upwork link! Offer sent 💃

@melvin-bot melvin-bot bot removed the Overdue label Aug 2, 2024
@daledah
Copy link
Contributor

daledah commented Aug 3, 2024

@sonialiap Accepted the offer thx

@melvin-bot melvin-bot bot added the Overdue label Aug 5, 2024
@sonialiap
Copy link
Contributor

Everyone has been paid ✔️

@melvin-bot melvin-bot bot removed the Overdue label Aug 5, 2024
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. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
Status: Done
Development

No branches or pull requests

8 participants