Failing to get search suggestions with "FormHistoryClient constructed with both a formField and an inputName" error (Stop using formAutofill in SearchSuggestionsController)
Categories
(Firefox :: Search, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox113 | --- | fixed |
People
(Reporter: mak, Assigned: standard8)
References
Details
(Whiteboard: [snt-scrubbed][search-techdebt])
Attachments
(3 files)
Sometimes search suggestions are not fetched and the console dumps a lot of "FormHistoryClient constructed with both a formField and an inputName" errors.
This is actually due to toolkit/components/satchel/nsFormFillController.cpp having a stuck mFocusedInput value. This value is set by startControllingInput and unset by stopControllingInput, so we're somehow missing the latter.
This actually happened to me when visiting about:preferences shortly after the browser startup, then mFocusedInput got stuck to the about:preferences search field, and when I tried to use the urlbar, FormFillController thought I was trying to access search-history from an input field.
I was not yet able to produce reproducible STR, it may be a race condition.
Ideally just focusing another autofill input field should exit the condition, since at that point startControllingInput would terminate the previous session.
Reporter | ||
Comment 1•4 years ago
|
||
I think we should stop using formAutofill in SearchSuggestionsController, and straight query FormHistory.jsm. We don't really need all the abstraction in the middle.
Reporter | ||
Comment 2•4 years ago
|
||
I found a possible way to reproduce this, it requires to restore previous session on startup, and have the last open tab be about:config. There's something with the focus change there not unregistering the controller. Didn't debug further yet.
Comment 4•3 years ago
|
||
OMG this gave me quite a laugh. about:config is definitely a 100% reliable way to reproduce it. I've been driving myself insane for days trying to figure out what happened. 1 error for every key pressed in the urlbar! I thought I must have broken one of my databases while experimenting with urlbar provider mods. I restarted like 50 times trying to figure out why sometimes it doesn't happen. I guess it just happens that when I'm testing with my real profile with like 300 tabs, I always restart/clear startup cache with my active tab on about pages because they load so much faster. So I was unknowingly reproducing it almost every time just by habit lol.
Assignee | ||
Comment 5•2 years ago
|
||
This is the code we should replace: https://searchfox.org/mozilla-central/rev/14781effaa15c12b1652beb75f021489567bad8f/toolkit/components/search/SearchSuggestionController.sys.mjs#350-411
Reporter | ||
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 6•2 years ago
|
||
I have a WIP patch for this, that I've had hanging around for a while.
Assignee | ||
Comment 7•2 years ago
|
||
This should cut out most of the abstraction in the middle of the nsIAutoComplete interfaces.
Depends on D162843
Assignee | ||
Comment 8•2 years ago
|
||
Updated•2 years ago
|
Assignee | ||
Comment 9•2 years ago
|
||
This moves creating FormAutoCompleteResult out of the controller and into SearchSuggestions.
SearchSuggestions is only used for the autocomplete interface and so this simplifies the work for content search and address bar.
Depends on D162844
Comment 10•2 years ago
|
||
Comment 11•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/b5cc114309cd
https://hg.mozilla.org/mozilla-central/rev/cf20f4f809be
https://hg.mozilla.org/mozilla-central/rev/22cb2543a2a1
Description
•