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-08-02] [$1000] Request Money input is not getting focus when navigating back #22610

Closed
1 of 6 tasks
kavimuru opened this issue Jul 11, 2023 · 36 comments
Closed
1 of 6 tasks
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

@kavimuru
Copy link

kavimuru commented Jul 11, 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. Request Money
  2. Enter Amount & Click Next
  3. See focus getting applied to input
  4. Click on any User contact
  5. Come back and see Input is not getting focus.

Expected Result:

Input should get focused in any case of navigation.

Actual Result:

Not getting in case of navigating 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.39-5
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

iu.mp4
Recording.1245.mp4

Expensify/Expensify Issue URL:
Issue reported by: @Mahesh-Vagicherla

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1689016031128029

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01612a76428b498945
  • Upwork Job ID: 1679156782678679552
  • Last Price Increase: 2023-07-12
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 11, 2023

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

@melvin-bot
Copy link

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

@tienifr
Copy link
Contributor

tienifr commented Jul 11, 2023

Proposal

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

Request Money input is not getting focus when navigating back

What is the root cause of that problem?

we just have the logic to focus input in componentDidMount, but if we go to the next page and go back, the previous page won't unmount that why the input is not re-focused

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

In OptionsSelector

We should add the logic to focus the input when the page is visible again in componentDidUpdate like what we did in WorkspaceInviteMessagePage

    componentDidUpdate(prevProps) {
        if (this.props.autoFocus && !prevProps.isFocused && this.props.isFocused) {
            setTimeout(()=>{
                this.textInput.focus();
            },[CONST.ANIMATED_TRANSITION])
        }

Using setTimeout is necessary because we can make sure that it will finish transition and then set focus.

If we don't want to use setTimeout, we can use InteractionManager.runAfterInteractions instead

Result

Screen.Recording.2023-07-11.at.11.08.37.mov

@maddylewis maddylewis added the External Added to denote the issue can be worked on by a contributor label Jul 12, 2023
@melvin-bot melvin-bot bot changed the title Request Money input is not getting focus when navigating back [$1000] Request Money input is not getting focus when navigating back Jul 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 12, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01612a76428b498945

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

melvin-bot bot commented Jul 12, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 12, 2023

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

@maddylewis
Copy link
Contributor

assigning contributor to review proposal

@multijump
Copy link
Contributor

Proposal

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

Request Money input is not getting focus when navigating back

What is the root cause of that problem?

When HeaderWithBackButton click, it just go back like browser history back.

navigationRef.current.goBack();

Then MoneyRequestParticipantsSelector component didn't rerendered and focus lost in input.

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

In the MoneyRequestConfirm component, fallback url is generated in navigateBack function but it is not used.
We can update to use this fallback url forcely to rerender MoneyRequestParticipantsSelector.

    const navigateBack = () => {
        let fallback;
        if (reportID.current) {
            fallback = ROUTES.getMoneyRequestRoute(iouType.current, reportID.current);
        } else {
            fallback = ROUTES.getMoneyRequestParticipantsRoute(iouType.current);
        }
        Navigation.goBack(fallback, true);
    };

We don't need to use setTimeout or change other components.

Result

Screen.Recording.2023-07-13.at.11.30.16.PM.mov

What alternative solutions did you explore? (Optional)

N/A
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@melvin-bot melvin-bot bot added the Overdue label Jul 14, 2023
@maddylewis
Copy link
Contributor

@eVoloshchak - bump on proposal reviews - thx!

@melvin-bot melvin-bot bot removed the Overdue label Jul 14, 2023
@eVoloshchak
Copy link
Contributor

@tienifr's proposal looks good to me
I think we should use InteractionManager.runAfterInteractions, the same approach is used on MoneyRequestAmountPage here (except it's relying on useFocusEffect to determine when screen is focused)

🎀👀🎀 C+ reviewed!

@melvin-bot
Copy link

melvin-bot bot commented Jul 16, 2023

Triggered auto assignment to @cead22, 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 17, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 17, 2023

📣 @eVoloshchak Please request via NewDot manual requests for the Reviewer role ($1000)

@melvin-bot
Copy link

melvin-bot bot commented Jul 17, 2023

📣 @tienifr 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

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
Copy link

melvin-bot bot commented Jul 17, 2023

📣 @mahesh! 📣
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. 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.
  2. 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.
  3. 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>

@melvin-bot
Copy link

melvin-bot bot commented Jul 17, 2023

The BZ member will need to manually hire Mahesh for the Reporter role. Please store your Upwork details and apply to our Upwork job so this process is automatic in the future!

@b4s36t4
Copy link
Contributor

b4s36t4 commented Jul 17, 2023

This bug has been reported by me @cead22 .

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 Weekly KSv2 labels Jul 26, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Request Money input is not getting focus when navigating back [HOLD for payment 2023-08-02] [$1000] Request Money input is not getting focus when navigating back Jul 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 26, 2023

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 26, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.45-7 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-08-02. 🎊

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

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

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

@melvin-bot
Copy link

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

  • [@eVoloshchak] The PR that introduced the bug has been identified. Link to the PR:
  • [@eVoloshchak] 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:
  • [@eVoloshchak] 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:
  • [@eVoloshchak] Determine if we should create a regression test for this bug.
  • [@eVoloshchak] 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.
  • [@maddylewis] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@maddylewis maddylewis added Daily KSv2 and removed Weekly KSv2 labels Jul 29, 2023
@maddylewis
Copy link
Contributor

moving to daily since payments are due early next week

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

Payment due on Aug 2

@melvin-bot melvin-bot bot added Daily KSv2 and removed Overdue Daily KSv2 labels Jul 31, 2023
@eVoloshchak
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: there isn't a PR that caused this regression, but rather something that wasn't implemented initially when creating BaseOptionsSelector
  • 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: N/A
  • 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: this is a visual bug, I don't think an additional discussion is needed
  • Determine if we should create a regression test for this bug.
    Is it easy to test for this bug? Yes
    Is the bug related to an important user flow? Yes
    Is it an impactful bug? No

    While not very impactful, the bug is annoying, and since it's also very easy to test, I think a small regression test would be suitable here.

@eVoloshchak
Copy link
Contributor

Regression Test Proposal

  1. Click FAB -> Request Money
  2. Enter an amount and click Next
  3. Verify that name & phone number input is focused
  4. Select any of the contacts
  5. Click Back
  6. Verify that name & phone number input is focused

Do we agree 👍 or 👎

@maddylewis
Copy link
Contributor

maddylewis commented Aug 2, 2023

Payments


  • Contributor hired on July 16
  • PR merged on July 24

@b4s36t4
Copy link
Contributor

b4s36t4 commented Aug 2, 2023

@maddylewis Accepted the offer in upwork. Thanks.

@eVoloshchak
Copy link
Contributor

Requested the payment via NewDot

@JmillsExpensify
Copy link

Reviewed details for @eVoloshchak. These details are accurate based on summary from Business Reviewer and are now approved for payment in NewDot.

@melvin-bot melvin-bot bot added the Overdue label Aug 6, 2023
@maddylewis
Copy link
Contributor

all payments sent - closing!

@melvin-bot melvin-bot bot removed the Overdue label Aug 6, 2023
@tienifr
Copy link
Contributor

tienifr commented Dec 1, 2023

I just noticed that this PR is approved by @eVoloshchak within 2 days, without any changes before final approval from Internal engineer and merging, here is the detail:

  • When I got assigned: 17 Jul 2023 19:29:00 GMT+0
  • when the PR got C+ approved: 19 Jul 2023 15:51:00 GMT+0
  • When the PR got merged: 24 Jul 2023 19:16:00 GMT+0
  • days elapsed: 7

I think it's eligible for urgency bonus. We also had the same case here

I know this issue was closed so long ago, and I apologize for this inconvenience and appreciate your attention to this matter 🙇. Thank you! cc @maddylewis

@tienifr
Copy link
Contributor

tienifr commented Dec 7, 2023

@maddylewis What do you think about this ^?

@tienifr
Copy link
Contributor

tienifr commented Jan 17, 2024

@maddylewis friendly bump

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
None yet
Development

No branches or pull requests

9 participants