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

Web - State field in connect bank account does not display selected value on revisit #23792

Closed
1 of 6 tasks
kbecciv opened this issue Jul 28, 2023 · 6 comments
Closed
1 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2

Comments

@kbecciv
Copy link

kbecciv commented Jul 28, 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
  2. Open settings
  3. Open workspaces
  4. Open any workspace
  5. Open bank account, click connect manually, fill in step 1 details and continue
  6. Click on state, select any value
  7. Reopen state and search for any non existing value or empty the search and go back
  8. Reopen state field and observe that instead of current selected value (like we do on similar fields like timezone, pronouns), it displays value kept in step 7

Expected Result:

App should display current selected value when we revisit state field in connect bank account like we do on timezone and pronouns page

Actual Result:

App does not display current selected when we change search in state field and revisit in connect back account.

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.3.47-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

state.field.bank.account.inconsistent.mp4
Recording.3965.mp4

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

View all open jobs on GitHub

@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 28, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 28, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 28, 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

@BhuvaneshPatil
Copy link
Contributor

Proposal

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

State field in connect bank account does not display selected value on revisit.

What is the root cause of that problem?

We are setting the value for searchValue in StatePicker component, and in the company step that component is not being unmounted. And whenever we are opening/clicking on state selector, we are just changing the value of setIsPickerVisible state.

And as that component is never unmounted, the state is preserved/not getting reset.

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

We need to set the state whenever we open or close the modal.
We have useEffect -

useEffect(() => {
setSearchValue(lodashGet(allStates, `${value}.stateName`, ''));
}, [value, allStates]);

That sets the searchValue. We can add the isPickerVisible to dependency array.

Alternatively,
we can also set the state in showPickerModal and hidePickerModal method of StatePicker component

result -

Screen.Recording.2023-07-28.at.5.32.52.PM.mov

What alternative solutions did you explore? (Optional)

@BhuvaneshPatil
Copy link
Contributor

Same RCA but different component - #23768

I have submitted proposal there as well

@s77rt
Copy link
Contributor

s77rt commented Jul 28, 2023

We can close this as a dupe.

@melvin-bot melvin-bot bot added the Overdue label Jul 31, 2023
@zanyrenney
Copy link
Contributor

closing as dupe!

@melvin-bot melvin-bot bot removed the Overdue label Jul 31, 2023
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. Daily KSv2
Projects
None yet
Development

No branches or pull requests

4 participants