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

Suggestions for autocomplete do not always appear #431

Closed
pwittchen opened this Issue Feb 6, 2019 · 9 comments

Comments

Projects
None yet
3 participants
@pwittchen
Copy link

pwittchen commented Feb 6, 2019

Internal ticket: https://app.asana.com/0/488551667048375/1108574295820133

This problem is related to autocomplete feature.

Steps to reproduce shows an example with bangs, but it happens for all kind of characters.

Steps to reproduce the problem

  1. Open the app
  2. Type ! in the address bar
  3. Suggestions appear
  4. Clear the address bar
  5. Type ! in the address bar again
  6. "No suggestions" message appear

Expected behavior

  • In the step 6 user should see suggestions.

Additional notes

  • When after performing all the steps to reproduce, I will type ! + any sign (e.g. !a) and then remove additional sign (a in the case of example), then suggestions appear
  • When after performing all the steps to reproduce, I will kill the app, open it again and type !, then suggestions appear
  • Address bar can be cleared in 3 ways (with backspace button on the keyboard, with x sign in the address bar or by pressing back button when keyboard is open) - in all cases behavior is the same

Question

  • Can you tell me, where in the code can I find implementation of the bangs? I searched it in SpecialUrlDetector.kt and I searched for keywords like "bang" and "bangs" in the GitHub repo, but I couldn't find anything.
@Dmitry-Borodin

This comment has been minimized.

Copy link

Dmitry-Borodin commented Feb 6, 2019

I can't reproduce the issue. What device are you using?
I always see the last page in address bar, when I clear it and put "!" there are suggestions appearing always. Clear and put "!" again doesn't help.

@CDRussell

This comment has been minimized.

Copy link
Contributor

CDRussell commented Feb 6, 2019

That's strange! I can replicate this; thanks for the detailed steps.

I wonder if it's due to RxJava filtering out results due to ! having been entered twice... The second time (after deleting and entering again) might be filtered out as not distinct.

We'll look into this, thanks.

@CDRussell

This comment has been minimized.

Copy link
Contributor

CDRussell commented Feb 6, 2019

Can you tell me, where in the code can I find implementation of the bangs?

There is no client-side code for the bangs; instead those are being returned from the autocomplete API.

The RxJava chain that is likely responsible is in here, in configureAutoComplete function

https://github.com/duckduckgo/Android/blob/develop/app/src/main/java/com/duckduckgo/app/browser/BrowserTabViewModel.kt#L214

@Dmitry-Borodin

This comment has been minimized.

Copy link

Dmitry-Borodin commented Feb 6, 2019

Just wrote the same, but wasn't sure. You can see URL changing in the address bar during bangs request.
[Usual search doesn't show DDG URL in the address bar. Probably this "redirect" shouldn't be shown as well]

@CDRussell

This comment has been minimized.

Copy link
Contributor

CDRussell commented Feb 6, 2019

It's not even unique to bangs; any search term will do in between deleting the characters and retyping.

Seems to maybe only happen on the blank tab page though.

@pwittchen

This comment has been minimized.

Copy link
Author

pwittchen commented Feb 7, 2019

@CDRussell thanks for the reply and pointing the place in the source code. Maybe I'll try to fix it in my free time when I find the root cause of this issue.

@pwittchen pwittchen changed the title Suggestions for bangs do not always appear Suggestions for autocomplete do not always appear Feb 7, 2019

@CDRussell

This comment has been minimized.

Copy link
Contributor

CDRussell commented Feb 7, 2019

I had a look at this to make sure the Rx thinking held up; it seems like the problem is related but is before it even gets to the Rx chain.

There are redundant checks that the query has changed performed, and one of these checks is erroneously preventing the empty query from getting through, which causes the oddity described.

I should have a small fix available for this soon; just checking it really is redundant and not needed for anything.

@CDRussell

This comment has been minimized.

Copy link
Contributor

CDRussell commented Feb 7, 2019

PR created for this #433

CDRussell added a commit that referenced this issue Feb 7, 2019

@CDRussell

This comment has been minimized.

Copy link
Contributor

CDRussell commented Feb 7, 2019

Thanks again for reporting this, and all the info provided. This should be fixed in the next release.

Let me know if it's still causing problems.

@CDRussell CDRussell self-assigned this Feb 7, 2019

@CDRussell CDRussell added the bug label Feb 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment