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-10-10] [$500] [Distance] - The system does not display "No result found" when entering an invalid address. #27165

Closed
1 of 6 tasks
kbecciv opened this issue Sep 11, 2023 · 89 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 Reviewing Has a PR in review

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. Go to "Settings."
  2. Click on "Profile."
  3. Select "Personal details."
  4. Choose "Home address."
  5. Enter an invalid address in the "address" field and observe that it displays "No result found" in the container.
  6. Now click FAB (Plus sign).
  7. From the menu, select the "Request Money" option.
  8. Opt for the "Distance" option.
  9. Click on "Start."
  10. Enter the same invalid address in the "address" field as previously done in step 5.
  11. Observe that "No result found" is not displayed.

Expected Result:

Upon entering an invalid address, the system should display "No result found."

Actual Result:

The system does not display "No result found" when entering an invalid address.

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

Bug.3.mp4
Recording.4388.mp4

Expensify/Expensify Issue URL:
Issue reported by: @usmantariq96
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1694077781824689

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01f72156da7ba00e25
  • Upwork Job ID: 1701260699268075520
  • Last Price Increase: 2023-09-11
  • Automatic offers:
    • DylanDylann | Contributor | 26812367
@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 [Distance] - The system does not display "No result found" when entering an invalid address. [$500] [Distance] - The system does not display "No result found" when entering an invalid address. Sep 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

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

@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 @tjferriss (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 - @burczu (External)

@DylanDylann
Copy link
Contributor

DylanDylann commented Sep 11, 2023

Proposal

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

[Distance] - The system does not display "No result found" when entering an invalid address

What is the root cause of that problem?

In waypointEditor, we pass predefinedPlaces props so we always have dataList
https://github.com/Expensify/react-native-google-places-autocomplete/blob/4324dd7b156075d1817fea60b007584fa73b08ea/GooglePlacesAutocomplete.js#L798-L800

It caused ListEmptyComponent (In this case: "No result found" Text) don't display

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

  1. Let's remove this props
    resultTypes=""

because we defined default resultTypes is address

  1. When displaying predefinedPlaces we need to display the Text: "Recent Destination" in header // Need to support translate in here
    In here:
    <GooglePlacesAutocomplete

    pass renderHeaderComponent props
renderHeaderComponent={() => !props.value && props.predefinedPlaces && <Text style={[styles.textLabel, styles.colorMuted, styles.pv4, styles.ph3, styles.overflowAuto]}>Recent Destination</Text>}

  1. We only display predefinedPlaces if the search input is empty so that
    In here
    predefinedPlaces={props.predefinedPlaces}

    update like this
predefinedPlaces={!props.value ? props.predefinedPlaces: undefined}
Screenshot 2023-09-15 at 20 08 29

If the textValue is not empty and there are some search result we will don't display predefinedPlaces

Screenshot 2023-09-15 at 20 08 36

If the textValue is not empty and there are no search result we will display no result found

Screenshot 2023-09-15 at 20 11 35

We also can easily move step 2,3 to our react-native-google-places-autocomplete fork.

Result

@akinwale
Copy link
Contributor

akinwale commented Sep 11, 2023

Proposal

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

When searching for an address in the Distance Request flow, the autocomplete input does not display "No results found" for an address with no results.

What is the root cause of that problem?

This is due to the fact that predefinedPlaces has been set for the AddressSearch component. The predefined places will still be displayed even when there are no results found to display, until the user stops typing. It looks like this is the way predefinedPlaces are always being handled in the Google Places Auto Complete module, although I'm not entirely sure why it's implemented this way.

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

Since Expensify maintains a fork of this module, we can change this behaviour if absolutely necessary. Essentially, we will force the no results empty component to show only after a request has been made, and no results were found.

  1. Update the buildRowsFromResults method and add a showNoResults boolean parameter which defaults to false (for backward compatibility).
const buildRowsFromResults = (results, showNoResults = false) => {
  1. Add the following lines to the buildRowsFromResults method.
let res = [];
+if (results.length === 0 && showNoResults) {
+  return [];
+}
  1. Update the _request method.
_results = results;
-setDataSource(buildRowsFromResults(results));
+setDataSource(buildRowsFromResults(results, true));

What alternative solutions did you explore? (Optional)

None.

@needpower
Copy link

needpower commented Sep 11, 2023

Proposal

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

A user enters the same address in two places:
(1) Settings -> Profile -> Personal Details -> Home address -> Address line 1
(2) FAB (Plus sign) -> Request Money -> Distance tab -> Start -> Address

Given the same prompt, field (1) displays "No results found", but field (2) displays a list of selectable addresses.

What is the root cause of that problem?

Field (1) fires an API request proxied to Google Maps API with filtering by place's type.
Field (2) does the same request without filtering by place's type.

Comparison of API requests in two fields, given the same prompt hhhh:
Field (1):
image
image

Field (2):
image
image

There are two root causes of the problem:

  1. Difference in filtering by address type.
  2. Distance address search displays recent waypoints if no results were found and no explicit message. Home address search displays a No results found message.

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

  1. Keep filtering by address type the same in Distance and Home address;
  2. Distance address search:
    renderHeaderComponent={
                        props.predefinedPlaces && !props.value ? (
                            <Text style={[styles.textLabel, styles.colorMuted, styles.pv4, styles.ph3, styles.overflowAuto]}>props.headerTitle</Text>
                        ) : null
                    }
    • When a user starts typing an address, the recent destination list goes away as we show a list of auto-completed addresses based on your search input. This is how it works right now, and no changes in the code are needed.
    • When the search results return no valid addresses, only show "no results found", without a recent destinations list. So here, we need to add the following condition:
      predefinedPlaces={props.predefinedPlaces}
      predefinedPlaces={props.value ? null : props.predefinedPlaces:}

What alternative solutions did you explore? (Optional)

N/A

@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

📣 @needpower! 📣
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>

@needpower
Copy link

needpower commented Sep 11, 2023

Contributor details
Your Expensify account email: artemlyubchuk@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~01f4dea1ffcf656fe2

@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@burczu
Copy link
Contributor

burczu commented Sep 12, 2023

I've checked the proposals and done my own investigation and it seems like to obtain exactly the same behaviour in Distance Address field as it is done in Personal Details Address field we need to mix two proposals into one.

If we only follow only the @DylanDylann's proposal we will get results like below:

Screenshot 2023-09-12 at 14 27 35

This is because filtering by address is disabled for Distance page, as @needpower pointed out in his proposal. If we additionally remove resultTypes="" property (by default it is set to "address") that is now added to the AddressSearch component in WaypointEditor then it it will work exactly the same as in Personal Details page.

Screenshot 2023-09-12 at 14 31 42

That being said, I think we should hire one of them to implement merged solution, and split the payment between them.

🎀 👀 🎀 C+ reviewed

P.S. After additional check we should probably not remove resultTypes="" but instead provide correct values, because filtering by address only may not be exactly what we need here.

@melvin-bot
Copy link

melvin-bot bot commented Sep 12, 2023

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

@trjExpensify
Copy link
Contributor

@neil-marcellini @hayata-suenaga @tgolen can I get your input on this one?

My initial take was that it wasn't a bug. If you have recent addresses when you're on the waypoint picker, you should see those instead of "no address found", though maybe there is some merit in being more explicit with "no address found" when your search input doesn't match any of your recent addresses for better feedback than this:

image

@burczu
Copy link
Contributor

burczu commented Sep 12, 2023

@trjExpensify yeah - I agree that maybe keeping the same behaviour in both places may not be the best option in the first place...

@tgolen
Copy link
Contributor

tgolen commented Sep 12, 2023

I agree that I do not feel strongly that these need to work exactly the same. The use case is different. One of them has the recent waypoints, and the other one does not. Therefore, there is different behavior for invalid address search.

I think IF we wanted them to be consistent, then it would be better to maintain a separate "recent address" collection for the profile search.

@needpower
Copy link

@tgolen I think from a UX perspective, users search and select distance addresses much more often than changing a home address. It makes sense to remember previous choices to facilitate the distance search for the case when a user what to use the same route in a money request.
But it doesn't work out the same way for home addresses, because there are no obvious reasons to remember previous home address.

cc @burczu @tjferriss

@trjExpensify
Copy link
Contributor

Yeah, I totally agree we don't need recent addresses in the home address search. My only question comes down to whether "no address found" should be displayed if you enter an invalid address into the search bar for feedback that what you're typing is yielding no results.

I do find this a bit strange:

qqYl9sP9nJ.mp4

@JmillsExpensify
Copy link

Agreed. I find that weird. We should be giving feedback for no results.

@hayata-suenaga
Copy link
Contributor

giving an explicit feedback that a result was not found might be a good idea

@mountiny
Copy link
Contributor

mountiny commented Oct 3, 2023

Yeah I think it just default to the recent result as it does not have the backend results yet.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 3, 2023
@melvin-bot melvin-bot bot changed the title [$500] [Distance] - The system does not display "No result found" when entering an invalid address. [HOLD for payment 2023-10-10] [$500] [Distance] - The system does not display "No result found" when entering an invalid address. Oct 3, 2023
@melvin-bot
Copy link

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

melvin-bot bot commented Oct 3, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.76-6 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-10-10. 🎊

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 Oct 3, 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:

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

@trjExpensify
Copy link
Contributor

👋 Can we get this checklist filled out to proceed with payments please?

@burczu
Copy link
Contributor

burczu commented Oct 17, 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:

  • [@burczu] The PR that introduced the bug has been identified. Link to the PR: I don't this is regression created by any other PR - this was just implemented in other way.
  • [@burczu] 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
  • [@burczu] 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
  • [@burczu] Determine if we should create a regression test for this bug.
  • [@burczu] 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.
  • [@trjExpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@trjExpensify
Copy link
Contributor

[@burczu] Determine if we should create a regression test for this bug.
[@burczu] 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.

Again here @burczu, there's no justification noted for this. I'd love to be able to read minds, but unfortunately I can't, so it would be good for you to communicate your reasoning.

@melvin-bot
Copy link

melvin-bot bot commented Oct 25, 2023

@burczu, @youssef-lr, @trjExpensify, @DylanDylann Whoops! This issue is 2 days overdue. Let's get this updated quick!

@melvin-bot
Copy link

melvin-bot bot commented Oct 27, 2023

@burczu, @youssef-lr, @trjExpensify, @DylanDylann Huh... This is 4 days overdue. Who can take care of this?

@burczu
Copy link
Contributor

burczu commented Oct 31, 2023

@trjExpensify

Again here @burczu, there's no justification noted for this. I'd love to be able to read minds, but unfortunately I can't, so it would be good for you to communicate your reasoning.

I think in this case it's just an UX fix, it was still possible to use distance selectors and the whole request money flow based on distance so the issue didn't break any flow in the App.

@trjExpensify
Copy link
Contributor

Got it. I guess I tend to agree that it's a fairly minor improvement to add to the regression test run standalone. I just took a cursory look through the distance requests ones and we're covered for things like auto-complete, placenames and no address found if you try to save, so I think that's sufficient without an explicit one for returning no results.

@trjExpensify
Copy link
Contributor

Proceeding on with payments then:

No urgency bonus to apply as per here. Once confirmed, I'll proceed to settle up.

Copy link

melvin-bot bot commented Nov 8, 2023

@burczu, @youssef-lr, @trjExpensify, @DylanDylann Whoops! This issue is 2 days overdue. Let's get this updated quick!

@trjExpensify
Copy link
Contributor

Settled up with @DylanDylann. @usmantariq96, I've sent you an offer.

@trjExpensify
Copy link
Contributor

Settled up with @usmantariq96, closing!

@DylanDylann
Copy link
Contributor

Settled up with @DylanDylann.

sorry @trjExpensify but it seems I wasn't paid out on the job yet. Could you help double check, thank you!

@trjExpensify
Copy link
Contributor

Cool yeah, I reached out to yah on Slack as it looked like it failed but you never know with Upwork! I've now settled up with you.

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 Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests