Move the omnibox heuristic result to the omnibox provider
Categories
(Firefox :: Address Bar, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox80 | --- | fixed |
People
(Reporter: mak, Assigned: bugzilla)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 3 obsolete files)
Bug 1642710 esposed the limits we have regarding the heuristic result, and providers composition, because yhere we would like (at least) to:
- have an extension heuristic result
- have extenstion results
- eventually fill up remaining space with search suggestions (or what we like)
If one would think this from scratch, it sounds like the new provide should provide both the heuristic result and other results, and then some other provider should fill up space.
And this has various problems for our current architecture:
We don't properly support multiple heuristic results, we should probably make the muxer wait for the heuristic result of all the PROVIDER_TYPE.HEURISTIC providers, and then pick one and discard the others, before returning any result. Or this provider should be restricting, but then we have problem 2
If we define a provider priority, then that provider is the only one running, but we'd like to fill up space with another provider... A possible idea: have a filling provider (search suggestion sounds like a good candidate) that can be invoked if a provider has an allowFillupResults property, or allow a restricting provider to define who is its filling provider, if any.
If this provider takes control, other providers should not spend time searching unless requested to fill up, since it may be pointless work.
After this brief analysis, it looks to me that the omnibox provider should be a restricting HEURISTIC provider, and that we need a way to define which providers should be used to fill remaining space, if any.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 1•5 years ago
|
||
Expanding on what Marco said about the muxer picking a heuristic provider, we could tackle this by defining a heuristicOrder
in the muxer that resolves priority ties between heuristic providers. Following the order currently defined in UnifiedComplete, it could look something like
const heuristicOrder = [
"UrlbarProviderOmnibox",
"UrlbarProviderKeywords", // Doesn't yet exist, would cover non-token aliases and keywords
"UrlbarProviderAutofill", // Doesn't yet exist
"UrlbarProviderTokenAliasEngines",
"UrlbarProviderUnifiedComplete", // Covers Places matches
"UrlbarProviderSearchSuggestions", // Handles searching with the current engine
];
That way, a provider can offer a heuristic result while not restricting non-heuristic results from other providers, much like how UnifiedComplete works now. This would allow us to use the usual priority system for fillups. We'd need to ensure that each provider is uniquely ranked, which is why I propose defining this as an ordered list in the Muxer rather than a heuristicPriority
value returned by each provider.
There are a number of // Doesn't yet exist
comments above... We could work on this in the short term just by starting with "UrlbarProviderOmnibox", "UrlbarProviderUnifiedComplete", and "UrlbarProviderSearchSuggestions", in that order, then adding to the list as work on bug 1623636 progresses.
Drew, any thoughts on these proposals?
Assignee | ||
Updated•5 years ago
|
Comment 2•5 years ago
|
||
I think it makes sense that it's the muxer's job to pick the heuristic, and that multiple providers can provide a heuristic.
I don't think I agree with the idea about designating providers to be fill-up providers. That seems a little kludgy to me. Ideally providers look at the query context, decide whether they want to be active, and then go off and produce all their results independent of what the muxer will do or what any other later stage in the process will do. I guess I'm open to the idea though if it turns out to be an important optimization.
It's been mentioned here, but just to be clear, we'll want to avoid flickering of the heuristic, meaning we don't want to pick one heuristic just to replace it with another a moment later. So the muxer will need to wait for all active heuristic providers to return their heuristic results before it can do anything. It will need a way to tell which active heuristic providers are still pending. Earlier versions of my form history patches added a context.activeProviders
array in the providers manager, right after active providers are determined. I would think we'd need that for this. (context.activeProviders
was an array of provider names, not the providers themselves, because the context must be serializable since it's passed to webextensions.)
Heuristic providers should add their heuristic results first so that the muxer isn't stuck waiting while their non-heuristic results are added. Maybe we could enforce that through the API somehow (startHeuristicQuery
below for example), but it could probably just be left to convention.
We currently have a context.heuristicResult
property that's set by the providers manager. The point of that property is to allow the muxer to determine whether there's a heuristic in O(1) time instead of O(number of results). That probably needs to become an array or set.
Finally, the providers manager queries heuristic providers immediately. For other providers it waits for a small timeout before calling their startQuery
. If we end up with many heuristic providers, we may want to rethink that distinction. For example, maybe the delay isn't useful. Or maybe we add another provider method called startHeuristicQuery
that would be called immediately on heuristic providers, while startQuery
would always be called on a delay for both heuristic and non-heuristic providers.
Assignee | ||
Comment 3•5 years ago
|
||
Assignee | ||
Comment 4•5 years ago
|
||
Depends on D80291
Assignee | ||
Comment 5•5 years ago
|
||
Depends on D80293
Assignee | ||
Comment 6•5 years ago
|
||
Depends on D80294
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 7•5 years ago
|
||
Including the patches for bug 1645521: https://treeherder.mozilla.org/#/jobs?repo=try&revision=53023f7f3bfdd1cfbeb29834c657e17e48c812b6
Comment 8•5 years ago
|
||
Comment on attachment 9157786 [details]
Bug 1645324 - Part 1 - Add ProviderHeuristicFallback. r?adw!
Revision D80291 was moved to bug 1645521. Setting attachment 9157786 [details] to obsolete.
Comment 9•5 years ago
|
||
Comment on attachment 9157788 [details]
Bug 1645324 - Part 2 - Allow for multiple heuristic providers and enable ProviderHeuristicFallback. r?adw!
Revision D80293 was moved to bug 1645521. Setting attachment 9157788 [details] to obsolete.
Comment 10•5 years ago
|
||
Comment on attachment 9157789 [details]
Bug 1645324 - Part 3 - Port unifiedcomplete tests. r?adw!
Revision D80294 was moved to bug 1645521. Setting attachment 9157789 [details] to obsolete.
Comment 11•5 years ago
|
||
Comment 12•5 years ago
•
|
||
Backed out 5 changesets (bug 1647881, bug 1645521, bug 1645324) for BC failures in urlbar/tests/browser/browser_autocomplete_a11y_label.js. CLOSED TREE
Log:
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=309084323&repo=autoland&lineNumber=8517
Push with failures:
https://treeherder.mozilla.org/#/jobs?repo=autoland&group_state=expanded&revision=65f90856987542a1bcdcdc582274f5bd16e2f5fa
Backout:
https://hg.mozilla.org/integration/autoland/rev/d71dd7660462b2aa8ec528d6df3b5a4591d45c39
Assignee | ||
Comment 13•5 years ago
|
||
Comment 14•5 years ago
|
||
Comment 15•5 years ago
|
||
bugherder |
Comment 16•5 years ago
|
||
Backed out as requested by harry for causing bug 1652024.
Backout link: https://hg.mozilla.org/integration/autoland/rev/a82cdd81945436f60f13e552140ea0d2886c84b6
Comment 17•5 years ago
|
||
Comment 18•5 years ago
|
||
Bug 1645521, Bug 1645324 and Bug 1650099 were relanded because backing them out on autoland caused the following xpcshell and browser chrome failures on tree: https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception&fromchange=a82cdd81945436f60f13e552140ea0d2886c84b6&failure_classification_id=2&tochange=f66c5cce90882c33c50a47302a20c6f900f982e4&selectedTaskRun=IrU8jzR1RBi-PAHF2_YGyw.0
Failure logs: https://treeherder.mozilla.org/logviewer.html#?job_id=309411577&repo=autoland
https://treeherder.mozilla.org/logviewer.html#?job_id=309411217&repo=autoland
Harry, please have a look over these failures. Thank you.
Comment 19•5 years ago
|
||
bugherder |
Comment 20•5 years ago
|
||
Backed out: https://hg.mozilla.org/integration/autoland/rev/863e463684183a334f15b465d932372e62d24a4f
Comment 21•5 years ago
|
||
I'm pretty sure this change has introduced a bug that is a little difficult to reproduce reliably.
Before, even if the preview hadn't updated to reflect the last couple of keystrokes, they would be included when hitting enter.
Now I have to wait for the preview to update, or whatever I typed will get trimmed or cropped to what the preview had updated to.
This means that if I type quickly and hit enter to google it, I often end up searching for fewer words than I intended.
I can attach a video of this happening if required, but you should be able to trigger it yourself if you type quickly enough.
Assignee | ||
Comment 22•5 years ago
|
||
I think you're running into a different form of bug 1652024, which should be fixed when this re-lands with the patches for bug 1648468 attached.
Comment 23•5 years ago
|
||
Comment 24•5 years ago
|
||
bugherder |
Assignee | ||
Comment 25•5 years ago
|
||
Christian, can you still reproduce the issue you described on the latest Nightly?
Comment 26•5 years ago
|
||
(In reply to Harry Twyford [:harry] from comment #25)
Christian, can you still reproduce the issue you described on the latest Nightly?
No, the issue has been resolved, thanks!
Description
•