Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.56k stars 2.9k forks source link

[HOLD for payment 2024-08-14] [$250] Wallet - State is not auto filled after selecting the address during "Get physical card" flow #46005

Closed lanitochka17 closed 3 months ago

lanitochka17 commented 3 months ago

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.10-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: N/A Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Log in to account that has Expensify Card (applausetester@applause.expensifail.com ).
  3. Go to Account settings > Wallet
  4. Click on the second Expensify card (for applausetester@applause.expensifail.com )
  5. Click Get physical card
  6. Enter phone number
  7. Proceed to "Enter your shipping address" step
  8. Enter address and select address from the suggestion list

Expected Result:

State will be auto filled after selecting the address

Actual Result:

State is not auto filled after selecting the address

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/user-attachments/assets/0ff535d7-f665-498a-bd7c-5fddf39d2a58

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01bc16c42b34fa53cc
  • Upwork Job ID: 1816816721648392124
  • Last Price Increase: 2024-07-26
  • Automatic offers:
    • DylanDylann | Reviewer | 103345980
    • nkdengineer | Contributor | 103345985
Issue OwnerCurrent Issue Owner: @zanyrenney
melvin-bot[bot] commented 3 months ago

Triggered auto assignment to @zanyrenney (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.

lanitochka17 commented 3 months ago

We think that this bug might be related to #wave-collect - Release 1

lanitochka17 commented 3 months ago

@zanyrenney 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

Krishna2323 commented 3 months ago

Proposal

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

Wallet - State is not auto filled after selecting the address during "Get physical card" flow

What is the root cause of that problem?

We are using the wrong prop defaultValue for passing the state value to StateSelector. https://github.com/Expensify/App/blob/1efdcc0db05ddb83af4ab5b91bde1218476730e6/src/components/AddressForm.tsx#L192-L198

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

We should be using value prop instead of defaultValue prop because that is expected inside StateSelector. https://github.com/Expensify/App/blob/1efdcc0db05ddb83af4ab5b91bde1218476730e6/src/components/StateSelector.tsx#L40-L43

We should also check in other places.

What alternative solutions did you explore? (Optional)

Result

https://github.com/user-attachments/assets/fc0ebe84-8d5b-440d-a983-4812790fa38d

zanyrenney commented 3 months ago

adding an external label, the bug is reproducible.

melvin-bot[bot] commented 3 months ago

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

melvin-bot[bot] commented 3 months ago

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

zanyrenney commented 3 months ago

hey @DylanDylann please review the proposal above.

nkdengineer commented 3 months ago

Proposal

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

State is not auto filled after selecting the address

What is the root cause of that problem?

In GetPhysicalCardAddress, we only get the address info from the draft value and we don't control the address state as we do in AddressPage.

https://github.com/Expensify/App/blob/5e6527613d0f234fcb22507b878697a2bec356c5/src/pages/settings/Wallet/Card/GetPhysicalCardAddress.tsx#L42

https://github.com/Expensify/App/blob/5e6527613d0f234fcb22507b878697a2bec356c5/src/pages/AddressPage.tsx#L95-L97 So the state is not auto-filled since the defaultVaule is used here and onAddressChanged prop is not passed in GetPhysicalCardAddress https://github.com/Expensify/App/blob/5e6527613d0f234fcb22507b878697a2bec356c5/src/components/AddressForm.tsx#L195

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

We should use the same way as we do in AddressPage to control the address state and fix some other bugs that we are handling in AddressPage like the state is not cleared after we change the country, ...

https://github.com/Expensify/App/blob/5e6527613d0f234fcb22507b878697a2bec356c5/src/pages/AddressPage.tsx#L95-L97

What alternative solutions did you explore? (Optional)

DylanDylann commented 3 months ago

@nkdengineer's proposal looks good to me. We implemented the solution for this bug before in AddressPage

πŸŽ€ πŸ‘€ πŸŽ€ C+ reviewed

melvin-bot[bot] commented 3 months ago

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

melvin-bot[bot] commented 3 months ago

πŸ“£ @DylanDylann πŸŽ‰ An offer has been automatically sent to your Upwork account for the Reviewer role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job

melvin-bot[bot] commented 3 months ago

πŸ“£ @nkdengineer πŸŽ‰ 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 πŸ“–

marcaaron commented 3 months ago

Not overdue.

nkdengineer commented 3 months ago

@DylanDylann this PR is ready for review

melvin-bot[bot] commented 3 months ago

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

melvin-bot[bot] commented 3 months ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.17-2 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-08-14. :confetti_ball:

For reference, here are some details about the assignees on this issue:

melvin-bot[bot] commented 3 months ago

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:

zanyrenney commented 3 months ago

2 days remaining before payout!

zanyrenney commented 3 months ago

checked neither are paid via ND.

zanyrenney commented 3 months ago

payment summary

paid @DylanDylann $250 via upwork paid @nkdengineer $250 via upwork.