Smart Text Selection is intermittent |
|||
Issue descriptionLooks like there is a race condition in Smart Selection -- sometimes when I tap "Northern California" on this page it selects just one word and sometimes it selects the whole phrase. https://www.google.com/url?q=https%3A%2F%2Famp.cnn.com%2Fcnn%2F2017%2F10%2F10%2Fus%2Fcalifornia-wildfire-by-the-numbers%2Findex.html&sa=D&sntz=1&usg=AFQjCNFkJLiyFb3I97-tUI6cezWFFU-2DA Seeing this on monochrome in the browser, but I suspect this also happens in WebView. Assigning to myself for now to confirm this.
,
Oct 10 2017
I'm having trouble reproducing this. I suspect the problem only happens often in Chrome when Contextual Search competes with Smart Selection to gather surrounding text. In the scenario above if the user has done the privacy opt-in or is on an http page CS gathers surrounding text when the user taps on the existing tap-selection in order to get surrounding text for conversational search (sent to icing). But when the pins show Smart Selection also requests surrounding text. However the surrounding text extraction code says it only supports one request at a time. https://cs.chromium.org/chromium/src/content/browser/frame_host/render_frame_host_impl.cc?type=cs&q=RenderFrameHostImpl::RequestTextSurroundingSelection&sq=package:chromium&l=2041
,
Oct 11 2017
If we can make sure the root reason is #2, need to prioritize issue 769949 then.
,
Oct 11 2017
,
Oct 11 2017
What is "conversational search" that is mentioned in comment #2? Why does it need to get the surrounding text? My understanding was there shouldn't be any competition between Smart Selection and Contextual Search because they can't both be triggered at the same time. I can see a race condition happening when the first tap (the CS tap) and second tap (Smart Selection tap) happen in quick succession and two |RequestTextSurroundingSelection()| are requested (one for each tap), but that doesn't seem to be what is happening here.
,
Oct 11 2017
Yes, I'm pretty sure that the race condition in #2 is causing the problem. In order to repro somewhat reliably I reload the page and longpress immediately afterwards. For the next few seconds the system is slow enough that the surrounding text from Contextual Search isn't done yet when Smart Selection activates. I'll look at options for addressing this from Contextual Search. Is there any scoping done on the work for issue 769949?
,
Oct 11 2017
The race happens because of our support for Conversational Search, which may not be an important feature: It allows the user to select something and then speak a query, e.g. "how tall is he". To support Conversational Search we're gathering surrounding text on long-press and sending it to icing, under some conditions. This means that both features are gathering text in response to long-press. Contextual Search suppresses at the UX level for long-press.
,
Oct 12 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/708197db129edcea4501ba1d62bdc16f8e4bb660 commit 708197db129edcea4501ba1d62bdc16f8e4bb660 Author: Donn Denman <donnd@google.com> Date: Thu Oct 12 21:28:57 2017 [TTS] Fix a race with Smart Selection. Introduces a fix for issue 773330 where gathering surrounding text on the page is requested multiple times but only a single call is supported. Disables the gathering of surrounding text for longpress when Smart Selection is active. Instead we send just the current selection to icing for the assistant to use. Also fix a logic error in whether surrounding text can be sent to icing or not. BUG= 773330 , 770502 Change-Id: I752271efecb27d931d3fc25d46a4d66ad9649875 Reviewed-on: https://chromium-review.googlesource.com/714378 Reviewed-by: Ted Choc <tedchoc@chromium.org> Reviewed-by: Theresa <twellington@chromium.org> Commit-Queue: Donn Denman <donnd@chromium.org> Cr-Commit-Position: refs/heads/master@{#508480} [modify] https://crrev.com/708197db129edcea4501ba1d62bdc16f8e4bb660/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchContext.java [modify] https://crrev.com/708197db129edcea4501ba1d62bdc16f8e4bb660/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java [modify] https://crrev.com/708197db129edcea4501ba1d62bdc16f8e4bb660/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchPolicy.java [modify] https://crrev.com/708197db129edcea4501ba1d62bdc16f8e4bb660/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java [modify] https://crrev.com/708197db129edcea4501ba1d62bdc16f8e4bb660/content/public/android/java/src/org/chromium/content_public/browser/WebContents.java
,
Oct 12 2017
Fixed by not gathering surrounding text when Smart Selection is active. Instead we will supply a context that's simply the word(s) selected. This means that the Google Assistant might be affected in a minor way -- instead of getting about 400 chars of context from the page it will just get the selection, along with the regular data. The regular data includes page title and URL -- the URL should allow attachment of entities similar to what was done with the full surrounding text. |
|||
►
Sign in to add a comment |
|||
Comment 1 by donnd@google.com
, Oct 10 2017