App icon indicating copy to clipboard operation
App copied to clipboard

[$1000] App displays fixed set of results for few seconds and closes when using symbols like (,@,?,# on first open in address1 field of home address

Open kavimuru opened this issue 1 year ago • 53 comments

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. Open the app
  2. Open settings
  3. Open Profile
  4. Open Personal details
  5. Open Home address
  6. Remove current entry in address 1 field and enter any of the following symbol : (,@,?,# and observe the result
  7. Press on back button
  8. Again open home address
  9. Remove current entry in address 1 field and enter any letter eg: a
  10. Observe the results

Expected Result:

If no results are present for the entry, app shouldn't display any result and if there are results for the entry, app should display those results

Actual Result:

App displays fixed set of result everytime for symbols and when trying with any letter, it again displays same fixed set of result first for 1-2 seconds before displaying actual results

Workaround:

unknown

Platforms:

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

  • [x] Android / native
  • [x] Android / Chrome
  • [x] iOS / native
  • [x] iOS / Safari
  • [x] MacOS / Chrome / Safari
  • [x] MacOS / Desktop

Version Number: 1.2.88-0 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:

https://user-images.githubusercontent.com/43996225/226756931-32da33d6-8bf3-40b4-9212-957032fab0b3.mp4

https://user-images.githubusercontent.com/43996225/226756950-09ee4fcb-6d46-437e-8164-1cdd7508426e.mp4

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~017c127888b5f727a7
  • Upwork Job ID: 1646583218445266944
  • Last Price Increase: 2023-04-13

kavimuru avatar Mar 21 '23 22:03 kavimuru

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

MelvinBot avatar Mar 21 '23 22:03 MelvinBot

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

MelvinBot avatar Mar 21 '23 22:03 MelvinBot

@johncschuster Eep! 4 days overdue now. Issues have feelings too...

MelvinBot avatar Mar 27 '23 18:03 MelvinBot

@johncschuster Still overdue 6 days?! Let's take care of this!

MelvinBot avatar Mar 29 '23 18:03 MelvinBot

@johncschuster Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!

MelvinBot avatar Mar 31 '23 09:03 MelvinBot

@johncschuster this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

MelvinBot avatar Apr 04 '23 09:04 MelvinBot

@johncschuster 12 days overdue now... This issue's end is nigh!

MelvinBot avatar Apr 04 '23 09:04 MelvinBot

This issue has not been updated in over 14 days. @johncschuster eroding to Weekly issue.

MelvinBot avatar Apr 07 '23 09:04 MelvinBot

@johncschuster this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks!

MelvinBot avatar Apr 11 '23 10:04 MelvinBot

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

MelvinBot avatar Apr 13 '23 09:04 MelvinBot

John is OOO, reassigning so this gets actioned. thanks!

laurenreidexpensify avatar Apr 13 '23 09:04 laurenreidexpensify

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

MelvinBot avatar Apr 13 '23 09:04 MelvinBot

I'm not able to reproduce this. When I enter a symbol, I get no suggested results at all.

lschurr avatar Apr 13 '23 14:04 lschurr

Triggered auto assignment to @flodnv (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

MelvinBot avatar Apr 13 '23 14:04 MelvinBot

@flodnv are you able to reproduce this?

lschurr avatar Apr 13 '23 14:04 lschurr

I can't reproduce either. Assuming this is fixed. Please reopen if I'm mistaken.

flodnv avatar Apr 13 '23 17:04 flodnv

Hi @laurenreidexpensify, @flodnv, am still able to recreate the issue. Can you try it again by following same steps as attached video? Let me know for any doubts.

https://user-images.githubusercontent.com/87513216/231850112-5fd1cda8-0d70-43ed-a98e-109a25ad1422.mp4

dhanashree-sawant avatar Apr 13 '23 18:04 dhanashree-sawant

Oh wow, now I see it! It only happens on the first try, if you missed it you have to try again.

flodnv avatar Apr 13 '23 18:04 flodnv

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

MelvinBot avatar Apr 13 '23 18:04 MelvinBot

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

MelvinBot avatar Apr 13 '23 18:04 MelvinBot

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

MelvinBot avatar Apr 13 '23 18:04 MelvinBot

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

MelvinBot avatar Apr 13 '23 18:04 MelvinBot

Proposal

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

The app displays fixed set of results for a few seconds and closes when using symbols like (,@,?,# on first open in address1 field of the home address

What is the root cause of that problem?

When every time the input change, we will call an API, and calling the API takes a few seconds.

For example, at the beginning the input is 'london' and then we remove letter by letter and enter "?". The order of API will be

  1. The API will call with "londo" params
  2. The API will call with "lond" params
  3. The API will call with "lon" params
  4. The API will call with "lo" params
  5. The API will call with "l" params
  6. The API will call with "?" params

After the "?" character is entered, the second or third API is responded and this result is updated, then the suggested data is displayed. After a moment, the sixth API is responded then the correct data is updated.

Although we call _abortRequests whenever the query change to abort the previous requests but we're putting _results and _requests in

https://github.com/Expensify/react-native-google-places-autocomplete/blob/e12768f1542e7982d90f6449798f0d6b7f18f192/GooglePlacesAutocomplete.js#L72-L73

That make _requests is always empty whenever the component is rendered

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

Solution 1: We should move these lines https://github.com/Expensify/react-native-google-places-autocomplete/blob/e12768f1542e7982d90f6449798f0d6b7f18f192/GooglePlacesAutocomplete.js#L72-L73

to outside of GooglePlacesAutocomplete

let _results = [];
let _requests = [];

export const GooglePlacesAutocomplete = forwardRef((props, ref) => {

Solution 2: We can use useRef for _results and _requests

What alternative solutions did you explore? (Optional)

NA

dukenv0307 avatar Apr 14 '23 07:04 dukenv0307

Proposal

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

GooglePlacesAutocomplete shows last api response data when we don't wait for the last character suggestions to be shown and remove it fast and then insert any character.

What is the root cause of that problem?

Basically when we remove last character fast from the input text before it's api gets completed, below is the flow eg. current TextInput value is ab

  1. It is showing the suggestions for the text ab
  2. Remove both characters fast with the delete/backspace key
  3. When letter b is deleted, it will make an api call for letter a
  4. Before the api responded with the result we are removing letter a, so datasource turns to an empty array and then it fills with the latter response of a
  5. Now whenever we type any letter, it will first show suggestions of the existing datasource result for a moment till it won't fetch new results

https://user-images.githubusercontent.com/14358475/232017804-e54e3f27-d76e-4768-94a6-21bb78341b8c.mov

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

When the TextInput gets empty we should first abort the existing requests and then update the datasource to the empty array here. _abortRequests(); https://github.com/Expensify/react-native-google-places-autocomplete/blob/e12768f1542e7982d90f6449798f0d6b7f18f192/GooglePlacesAutocomplete.js#L558-L561

We can raise an issue to the actual lib https://github.com/FaridSafi/react-native-google-places-autocomplete or we can apply the change in our forked repo.

Pujan92 avatar Apr 14 '23 10:04 Pujan92

@dukenv0307

When the input is cleared, we will destroy all before APIs

How are you planning to do that?

Santhosh-Sellavel avatar Apr 15 '23 01:04 Santhosh-Sellavel

Bump @Santhosh-Sellavel @dukenv0307

lschurr avatar Apr 17 '23 15:04 lschurr

@flodnv @lschurr @Santhosh-Sellavel this issue is now 4 weeks old and preventing us from maintaining WAQ, can you:

  • Decide whether any proposals currently meet our guidelines and can be approved as-is today
  • If no proposals meet that standard, please take this issue internal and treat it as one of your highest priorities
  • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

Thanks!

MelvinBot avatar Apr 18 '23 10:04 MelvinBot

Current assignee @Santhosh-Sellavel is eligible for the Internal assigner, not assigning anyone new.

MelvinBot avatar Apr 18 '23 10:04 MelvinBot

@Santhosh-Sellavel @lschurr I've updated my proposal a bit: https://github.com/Expensify/App/issues/16367#issuecomment-1508094399 Please help take a look

dukenv0307 avatar Apr 18 '23 12:04 dukenv0307

@Pujan92 Already _abortRequests is called here I'm not sure what difference it makes can you explain?

Santhosh-Sellavel avatar Apr 19 '23 00:04 Santhosh-Sellavel