Closed
Bug 337386
Opened 20 years ago
Closed 20 years ago
search suggestion autocomplete latency/delay can make search slow to respond or seem broken
Categories
(Firefox :: Search, defect)
Tracking
()
VERIFIED
FIXED
Firefox 2 beta1
People
(Reporter: beltzner, Assigned: mconnor)
References
Details
(Keywords: verified1.8.1, Whiteboard: 181b1+)
Attachments
(2 files)
|
1.60 KB,
patch
|
bugs
:
review+
mtschrep
:
approval1.8.1+
|
Details | Diff | Splinter Review |
|
1.25 KB,
patch
|
Gavin
:
review+
mtschrep
:
approval1.8.1+
|
Details | Diff | Splinter Review |
If network latency between the client and the search suggestion data centre is high (or if that data centre is otherwise unavailable) then typing in the suggests box is sluggish, and clicking the "search" button or hitting enter fails to actually send the search query. After a few seconds, the suggestion terms pop into view and the search continues. Seems to only happen once a session. If needed, I can research more detailed STR.
| Reporter | ||
Comment 1•20 years ago
|
||
Resummarizing; mconnor informs me that network latency might not be the culprit, but rather our own autocomplete code might be.
Summary: search suggestion latency can make it seem like the search field is broken → search suggestion autocomplete latency can make it seem like the search field is broken
| Assignee | ||
Comment 2•20 years ago
|
||
This seems to be the oddball autocomplete behaviour Ben's comments in the suggest code referenced. Will try reimplementing his enter key handler.
Flags: blocking-firefox2+
Comment 3•20 years ago
|
||
Seeing this on Win XP trunk builds as well. And not only once per session, but frequently. At first I thought it was just that the search bar no longer responded to the enter key, but now I see it's just very slow.
It seems like the more complex the search term (especially gibberish), the more likely that it's going to be delayed or fail.
Also adding to summary to make it easier to find.
OS: Mac OS X 10.3 → All
Hardware: Macintosh → All
Summary: search suggestion autocomplete latency can make it seem like the search field is broken → search suggestion autocomplete latency/delay can make search slow to respond or seem broken
Comment 4•20 years ago
|
||
*** Bug 338579 has been marked as a duplicate of this bug. ***
Comment 5•20 years ago
|
||
*** Bug 340030 has been marked as a duplicate of this bug. ***
| Assignee | ||
Updated•20 years ago
|
Status: NEW → ASSIGNED
Whiteboard: [SWAG: 0.5d]
Comment 6•20 years ago
|
||
*** Bug 342355 has been marked as a duplicate of this bug. ***
Updated•20 years ago
|
Severity: normal → major
Updated•20 years ago
|
Whiteboard: [SWAG: 0.5d] → [SWAG: 0.5d] 181b1+
Comment 7•20 years ago
|
||
*** Bug 343045 has been marked as a duplicate of this bug. ***
Comment 8•20 years ago
|
||
From the original version of suggest.js (pre-release, 2005 - i.e. not the one that was released earlier):
/**
* Work around a KeyEvent bug in Firefox 1.0's AutoComplete implementation.
* The AutoComplete widget in Firefox 1.0 works as follows:
* If the user starts typing some text, the AutoComplete Search operation is
* initiated. If the user presses ENTER before the search is complete, the
* search continues and nothing happens but the fact that they did is noted
* so that when the search is complete, navigation can occur automatically
* rather than showing results in a popup.
*
* So, rather than invoking the ENTER-handler immediately, the VK_RETURN
* KeyEvent is cached on the AutoComplete textbox until the search is
* complete, then the cached event is passed through to the async handler.
* Unfortunately, the nsEvent referred to by the cached DOMEvent is stack
* allocated, and the pointer held by the DOMEvent will point to random
* memory after event dispatch is complete. The effect as far as the user
* is concerned in this case is that really weird stuff can happen.
*
* The solution is to ignore the AutoComplete widget's odd behavior of
* waiting for a search to complete before processing the result of a
* user's Enter keypress and simply start loading the URL or search
* query right away - the user wanted it now, not at some later time after
* the search result returns. To do this we must handle enter key presses.
*
* See https://bugzilla.mozilla.org/show_bug.cgi?id=281859 for more info.
*
* TODO(beng): special-case this for affected versions once the bug is fixed
* in an official release.
* @private
*/
_initEventHack: function() {
var searchbar = document.getElementById("searchbar");
var urlbar = document.getElementById("urlbar");
var self = this;
/**
* Replacement for the AutoComplete textbox's onTextEntered function.
* Required to override default async Enter Key Event handler. We must
* replace this method because some conditions cause it to be called
* and as a result spurious load events fired with the trashed
* memory.
* @return true to tell any handling code that everything is swell.
*/
function onTextEntered() {
this.mEnterEvent = null;
return true;
}
searchbar.onTextEntered = onTextEntered;
urlbar.onTextEntered = onTextEntered;
searchbar.addEventListener("keypress",
function(event) { self._onFieldKeyPress(event); },
false);
urlbar.addEventListener("keypress",
function(event) { self._onFieldKeyPress(event); },
false);
},
/**
* Handle VK_RETURN KeyEvents in the Location Bar and Search Bar by loading
* the result of the user's input and stopping any active searches immediately.
* @param event nsIDOMKeyEvent representing the KeyEvent
* @private
*/
_onFieldKeyPress: function(event) {
if (event.keyCode != KeyEvent.DOM_VK_RETURN)
return;
var field = event.target;
// Identify the search service being used by this autocomplete field and
// stop any pending searches.
var contractIDKey = field.getAttribute("autocompletesearch")
var contractID = this._searchServiceContractID + contractIDKey;
var searchService = Components.classes[contractID]
.getService(Components.interfaces.nsIAutoCompleteSearch);
field.fireEvent("textentered", event);
searchService.stopSearch();
},
Mysteriously in my trials this problem disappeared so I removed the code.
A real fix in the context of firefox would probably get rid of this whole mEnterEvent nonsense entirely and just fire the textentered event from the keypress handler.
Comment 9•20 years ago
|
||
I was under the impression that bug 339697 fixed this, but I guess not. Should bug 281859 be reopened?
Comment 10•20 years ago
|
||
To me, it looks like it only happens when no suggestions list shows up. If I indeed search for something uncommon, no suggestions will come up, and I won't be able to press enter to actually search. Though it works just fine when the suggestionslist has shown up at least once for the current search.
| Assignee | ||
Comment 11•20 years ago
|
||
been running with this patch on my mac build for a while, haven't been able to reproduce with it. There's some degree of suckage here, but the hack seems lower-risk than mucking with autocomplete's behaviour on branch.
Attachment #228103 -
Flags: review?(bugs)
Comment 12•20 years ago
|
||
Comment on attachment 228103 [details] [diff] [review]
ben's hack, better-integrated
r=ben@mozilla.org
Attachment #228103 -
Flags: review?(bugs) → review+
Updated•20 years ago
|
Whiteboard: [SWAG: 0.5d] 181b1+ → [SWAG: 0.5d] 181b1+ [checkin needed]
Updated•20 years ago
|
Whiteboard: [SWAG: 0.5d] 181b1+ [checkin needed] → [SWAG: 0.5d] 181b1+
Comment 13•20 years ago
|
||
I landed this on the trunk for mconnor, since he's away.
mozilla/browser/components/search/content/search.xml 1.76
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Updated•20 years ago
|
Attachment #228103 -
Flags: approval1.8.1?
Updated•20 years ago
|
Whiteboard: [SWAG: 0.5d] 181b1+ → [need-a] 181b1+
Updated•20 years ago
|
Attachment #228103 -
Flags: approval1.8.1? → approval1.8.1+
Updated•20 years ago
|
Whiteboard: [need-a] 181b1+ → [checked needed (1.8 branch)] 181b1+
Updated•20 years ago
|
Whiteboard: [checked needed (1.8 branch)] 181b1+ → [checkin needed (1.8 branch)] 181b1+
Comment 14•20 years ago
|
||
mozilla/browser/components/search/content/search.xml 1.37.2.43
Keywords: fixed1.8.1
Whiteboard: [checkin needed (1.8 branch)] 181b1+ → 181b1+
Comment 15•20 years ago
|
||
It think this is still happening on Mozilla/5.0 (Windows;;; en-US; rv:1.8.1a3) Gecko/20060707 BonEcho/2.0a3 ID:2006070704
I'll report again if I can confirm it in the 20060708 nightly.
There is more discussion here:
http://forums.mozillazine.org/viewtopic.php?t=433818
Comment 16•20 years ago
|
||
I'm still experiencing this problem (pressing Enter in the search bar sometimes does nothing) using Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.9a1) Gecko/20060707 Minefield/3.0a1.
Updated•20 years ago
|
Comment 17•20 years ago
|
||
Testing this, the event handler isn't even reached.
Comment 18•20 years ago
|
||
Gecko passes both the return key and the enter key are passed as VK_RETURN.
Attachment #228594 -
Flags: review?(gavin.sharp)
Comment 19•20 years ago
|
||
s/are passes/
Updated•20 years ago
|
Attachment #228594 -
Flags: approval1.8.1?
Comment 20•20 years ago
|
||
I'm hitting this bug still, too. I'll test out asaf's patch and confirm that on win32 it fixes the problem.
just some questions:
> Gecko passes both the return key and the enter key are passed as VK_RETURN
is this true for both the enter and return key on the mac, too?
if so, what does that mean that lines of code like:
http://lxr.mozilla.org/mozilla1.8/source/mail/extensions/newsblog/content/feed-subscriptions.js#478
and
http://lxr.mozilla.org/mozilla1.8/source/extensions/xforms/resources/content/select1.xml#186
Should search.xml handle both, or should select1.xml and feed-subscriptions.js be fixed?
Updated•20 years ago
|
Attachment #228594 -
Flags: review?(gavin.sharp) → review+
Comment 21•20 years ago
|
||
Yes, we're always passing DOM_VK_RETURN, this is a long-standing issue, see bug 105990.
As for the cases you've mentioned, we just never hit them, this is a very common mistake (probably due to the constant names).
Comment 22•20 years ago
|
||
trunk: mozilla/browser/components/search/content/search.xml 1.77
Status: REOPENED → RESOLVED
Closed: 20 years ago → 20 years ago
Resolution: --- → FIXED
Comment 23•20 years ago
|
||
asaf, thanks for the explanation and background on VK_ENTER / VK_RETURN.
> I'll test out asaf's patch and confirm that on win32 it fixes the problem.
update: I haven't seen this bug since applying asaf's patch to my bonecho tree on windows.
for my own benefit, I've confirmed that on win32 the VK_RETURN handler gets hit (for both enter and return) whereas the VK_ENTER doesn't.
in case mtschrep is do approvals today, I think this is one we'd definitely want for b1. hopefully, it is not too late.
Comment 24•20 years ago
|
||
Its NOT fixed in this version best I can tell:
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1b1) Gecko/20060709 BonEcho/2.0b1 ID:2006070915
Comment 25•20 years ago
|
||
Comment on attachment 228594 [details] [diff] [review]
Switch to VK_RETURN
Figuring this is a low-risk high impact change for the b1 respin.
Attachment #228594 -
Flags: approval1.8.1? → approval1.8.1+
Comment 26•20 years ago
|
||
1.8:
Checking in browser/components/search/content/search.xml;
/cvsroot/mozilla/browser/components/search/content/search.xml,v <-- search.xml
new revision: 1.37.2.44; previous revision: 1.37.2.43
done
Keywords: fixed1.8.1
Comment 27•20 years ago
|
||
verified with recent builds on Windows and Mac
Status: RESOLVED → VERIFIED
Keywords: fixed1.8.1 → verified1.8.1
Comment 28•20 years ago
|
||
*** Bug 338717 has been marked as a duplicate of this bug. ***
Comment 29•20 years ago
|
||
*** Bug 345191 has been marked as a duplicate of this bug. ***
Comment 30•20 years ago
|
||
I've backed out the patch for this bug in bug 344189, to try another solution. If people see this bug again (enter not working in the search bar) in tomorrow's builds (or any build with that change in it) please comment in bug 344189.
Comment 31•20 years ago
|
||
Tip for the users: when the search doesn't start with the enter key, press the down arrow on you keyboard, then the search will start.
You need to log in
before you can comment on or make changes to this bug.
Description
•