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-09-29] [$500] Web - App does not display address suggestion after clicking 'Fix the errors' link #27181

Closed
6 tasks
kbecciv opened this issue Sep 11, 2023 · 35 comments · Fixed by #27825
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

@kbecciv
Copy link

kbecciv commented Sep 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. Open the app
  2. Click on plus and click on request money
  3. Click on distance
  4. Open Start/Finish
  5. Type in any random text and click on Save
  6. Focus back on input, remove the random text and type in text which will trigger suggestions eg: ind
  7. When suggestion is open, click on 'Fix the errors' link
  8. Observe that suggestion closes, try removing all text and rewrite text that will trigger suggestions and observe that suggestions are not displayed
  9. Click in empty space below input to lose focus and again focus on input, observe that now suggestions work fine

Expected Result:

Fix the errors link should not disable address suggestions

Actual Result:

Fix the errors link disables address suggestions in waypoint pages

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

suggestion.address.is.not.triggered.again.mov
Recording.4394.mp4

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~017e44e8bf9e07ab26
  • Upwork Job ID: 1701286801034104832
  • Last Price Increase: 2023-09-18
  • Automatic offers:
    • jjcoffee | Reviewer | 26745226
    • bernhardoj | Contributor | 26745229
    • dhanashree-sawant | Reporter | 26745230
@kbecciv kbecciv added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 11, 2023
@melvin-bot melvin-bot bot changed the title Web - App does not display address suggestion after clicking 'Fix the errors' link [$500] Web - App does not display address suggestion after clicking 'Fix the errors' link Sep 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

Job added to Upwork: https://www.upwork.com/jobs/~017e44e8bf9e07ab26

@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

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

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

melvin-bot bot commented Sep 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

@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

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

@abdel-h66
Copy link
Contributor

Proposal

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

Suggestions list disappears after clicking 'Fix the errors' link

What is the root cause of that problem?

When clicking fix the errors link, the Text input does not seem to be blurred, as the onBlur is never trigerred. Not sure if this is coming from the Autocomplete lib or something else.

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

I have found a way to force the blur on the text input when calling onFixTheErrorsLinkPressed

App/src/components/Form.js

Lines 421 to 423 in fd3a753

if (focusInput.focus && typeof focusInput.focus === 'function') {
focusInput.focus();
}

By checking if the input is focused, forcing it to go onBlur and then call the focus() method

                            // Focus the input after scrolling, as on the Web it gives a slightly better visual result
                            if (focusInput.focus && typeof focusInput.focus === 'function') {
                                if(focusInput.isFocused()) {
                                    focusInput.blur();
                                }
                                focusInput.focus();
                            }

What alternative solutions did you explore? (Optional)

N/A

@bernhardoj
Copy link
Contributor

Proposal

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

Address autocomplete suggestion list hides when we press Fix the errors.

What is the root cause of that problem?

This issue is coming from our fork of react-native-google-places-autocomplete. Clicking the Fix the errors shouldn't close the list because the input is still in a focused state, but this (old) PR adds a new behavior to the lib to always hide the list if we click outside of the autocomplete suggestion element.

It's to fix this issue where the list didn't close if we moved away from it using the Tab key. The root cause of it is explained here. The solution to that issue is:

  1. Hide the list of a click that happened outside of the autocomplete elements.
  2. Add onBlur to each list item Pressable so moving away with Tab will call the onBlur

onBlur will hide the list if the blur is triggered by elements outside of the autocomplete elements.

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

The hide when clicking outside solution (1) is actually not necessary. It's to handle the case where the list is still visible after moving away from it using the Tab key, but it won't ever happen if we already hide it when we are moving away from the list by putting onBlur to each item in the list (2).

So, the solution is simply to remove the hide when clicking outside logic (outsideClickHandler).

@jjcoffee
Copy link
Contributor

jjcoffee commented Sep 12, 2023

@abdel-h66 To avoid blindly adding fixes where we don't understand the root cause fully, I think it'd be useful to understand why the input is not blurred in this case. Otherwise we risk adding workarounds, rather than solid fixes.

@bernhardoj Hiding the list if we click outside the autocomplete element is the expected behaviour, so we wouldn't want to remove that! I see that clicking Fix the errors doesn't blur the input, but it seems like it should?

@bernhardoj
Copy link
Contributor

I see that clicking Fix the errors doesn't blur the input, but it seems like it should?

@jjcoffee this PR makes pressing the Fix the errors does not blur the text input.

Hiding the list if we click outside the autocomplete element is the expected behaviour

It will still hide if we click outside but only if clicking outside blurs the text input. So, the only way to hide the list is to blur the autocomplete elements. I would say that the outsideClickHandler is a workaround.

@jjcoffee
Copy link
Contributor

@bernhardoj Thanks, that cleared things up for me!

Happy to go with @bernhardoj's proposal! The RCA is correct and the solution makes sense.

🎀👀🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Sep 15, 2023

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

@melvin-bot melvin-bot bot added the Overdue label Sep 18, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 18, 2023

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

@Beamanator
Copy link
Contributor

Sorry y'all, looking today!

@melvin-bot melvin-bot bot removed the Overdue label Sep 19, 2023
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 19, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 19, 2023

📣 @jjcoffee 🎉 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
Copy link

melvin-bot bot commented Sep 20, 2023

🎯 ⚡️ Woah @jjcoffee / @bernhardoj, great job pushing this forwards! ⚡️

The pull request got merged within 3 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉

  • when @bernhardoj got assigned: 2023-09-19 03:31:07 Z
  • when the PR got merged: 2023-09-20 08:10:27 UTC

On to the next one 🚀

@bernhardoj
Copy link
Contributor

Looks like it's unintentionally gets closed

@alexpensify
Copy link
Contributor

alexpensify commented Sep 20, 2023

@Beamanator - did you mean to close this one because it's a dupe?

@alexpensify alexpensify reopened this Sep 20, 2023
@Beamanator
Copy link
Contributor

I didn't close it on purpose, I merged a PR and GH had some automation that auto-closed this :D So thanks for reopening @alexpensify ! 👍

@alexpensify
Copy link
Contributor

All good! We are back on track now.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Sep 22, 2023
@melvin-bot melvin-bot bot changed the title [$500] Web - App does not display address suggestion after clicking 'Fix the errors' link [HOLD for payment 2023-09-29] [$500] Web - App does not display address suggestion after clicking 'Fix the errors' link Sep 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 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 Sep 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.72-11 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-09-29. 🎊

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 Sep 22, 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:

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

@alexpensify
Copy link
Contributor

Here is the payment summary:

Upwork Job: https://www.upwork.com/jobs/~017e44e8bf9e07ab26

*If applicable, the bonuses will be applied on the final payment

Extra Notes regarding payment: There is a urgency bonus here and everyone has been paid in Upwork.

@jjcoffee - please complete the checklist and we can close this GH. Thanks!

@jjcoffee
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: Fix: Search results list closing issues react-native-google-places-autocomplete#1
  • 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: Fix: Search results list closing issues react-native-google-places-autocomplete#1 (comment)
  • 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: N/A - this would be a hard one to catch as it happens in pretty specific circumstances
  • Determine if we should create a regression test for this bug. Yes - it's pretty bad if users can't enter an address.
  • 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. see below

@jjcoffee
Copy link
Contributor

Regression Test Proposal

  1. Click on FAB and click on Request Money.
  2. Click on distance.
  3. Open Start/Finish.
  4. Type in any text in the address input.
  5. Press Save without selecting any address. You will get a form error.
  6. Focus back on the address input and type some text to trigger suggestions.
  7. Click on 'Fix the errors' link.
  8. Verify that the suggestions stay open and you can continue typing to trigger further suggestions.

Do we agree 👍 or 👎

@jjcoffee
Copy link
Contributor

@alexpensify Checklist complete!

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Sep 29, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 2, 2023

@Beamanator, @alexpensify, @jjcoffee, @bernhardoj Whoops! This issue is 2 days overdue. Let's get this updated quick!

@Beamanator
Copy link
Contributor

Payment should happen soon, we are all coming back from a very busy week :D

@melvin-bot melvin-bot bot removed the Overdue label Oct 2, 2023
@alexpensify
Copy link
Contributor

alexpensify commented Oct 2, 2023

Everyone was paid last week - here. @Beamanator - this GH is open because we need your approval for this regression test:

#27181 (comment)

Thanks!

@Beamanator
Copy link
Contributor

Aah i wasn't aware we were waiting on me, sorry :D Regression test looks good!

@alexpensify
Copy link
Contributor

Closing - the regression test request has been created, so going to close this out here.

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

Successfully merging a pull request may close this issue.

7 participants