can't access property "heuristic", firstResult is undefined
Categories
(Firefox :: Address Bar, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox78 | --- | fixed |
People
(Reporter: kernp25, Assigned: adw)
Details
Attachments
(3 files, 1 obsolete file)
I have seen this error in console: can't access property "heuristic", firstResult is undefined
My browser version: 77.0a1 (2020-05-04) (64-Bit)
Assignee | ||
Comment 3•5 years ago
|
||
Thanks for flagging me. According to the stack, _chunkTimer
has fired after user input, notifying the view of results, but there are no results. That means the providers are really slow, or maybe the query was canceled before any of them returned results. notifyResults
should bail if the query is canceled, and somewhere along the way, we should also bail if there are no results. That should probably happen in notifyResults
since consumers shouldn't be notified when there are actually no results. In fact that's what one of my patches in bug 1398416 does, so I'll mark it as a dependency and hopefully we can fix this there.
If you do manage to figure out how to reliably reproduce it, I'd be interested.
This seems to happen at startup (if the browser is loading/busy).
Assignee | ||
Comment 5•4 years ago
|
||
Bug 1398416 ended up not making the change I mentioned in comment 3, so this is likely still a problem. It should be easy enough to fix, but first it would be nice to investigate exactly why this is happening. I still do think it's probably just that the chunk timer fires before results are ready because the results are slow to be fetched. That's consistent with this happening at startup when the browser is busy doing many things.
It seems to happen, if you type "w" at the address bar (maybe "www"?).
Can you look at the video?
Assignee | ||
Comment 10•4 years ago
|
||
Thanks for investigating this some more. The stack in your video, like the stack in your screenshot, shows that we're notifying due to the chunk timer timing out. So the chunk timer is timing out before any results have been fetched. All we need to do is bail from _notifyResults
if there are no results, or alternatively don't call _notifyResults
from the chunk timer callback.
Assignee | ||
Comment 11•4 years ago
|
||
No wait, that doesn't make sense. We only start the chunk timer when a non-heuristic provider adds results. So there should always be at least one result when the chunk timer fires.
So I'll have to think more about why this is happening. It's not a problem with canceling the query since we also cancel the chunk timer.
Assignee | ||
Comment 12•4 years ago
|
||
Could you please enable some logging and post the log here? First, run this in the browser console. It enables a bunch of urlbar logging:
(function() {
let log = Log.repository.getLogger("Urlbar");
log.addAppender(new Log.DumpAppender());
log.addAppender(new Log.ConsoleAppender());
})();
Then please reproduce the error. You should see a lot of "Urlbar" log lines in both the browser console and your Windows terminal/console, if you started Firefox that way. They are the same logs, so you can look at whichever one is easier. Thanks.
Reporter | ||
Comment 13•4 years ago
|
||
1590570334343 Urlbar.ProvidersManager INFO Query start w
1590570334343 Urlbar.ProvidersManager INFO Using muxer UnifiedComplete
1590570334343 Urlbar.Tokenizer INFO Tokenizing: {"allowAutofill":true,"isPrivate":false,"maxResults":10,"searchString":"w","allowSearchSuggestions":true,"currentPage":"about:home","formHistoryName":"searchbar-history","lastResultCount":0,"userContextId":0}
1590570334344 Urlbar.Tokenizer DEBUG Restriction chars: ^+%?#$
1590570334344 Urlbar.Tokenizer INFO Found tokens: ["w"]
1590570334344 Urlbar.Tokenizer DEBUG userinfo:
1590570334345 Urlbar.Tokenizer DEBUG hostPort: w
1590570334345 Urlbar.Tokenizer INFO Filtered Tokens: ["w"]
1590570334345 Urlbar.ProvidersManager DEBUG Context sources 1,2,3,4,5,6
1590570334347 Urlbar.Provider.UnifiedComplete INFO Starting query for w
1590570334347 Urlbar.Tokenizer INFO Tokenizing: {"searchString":"w"}
1590570334348 Urlbar.Tokenizer DEBUG Restriction chars: ^+%?#$
1590570334348 Urlbar.Tokenizer INFO Found tokens: ["w"]
1590570334348 Urlbar.Tokenizer DEBUG userinfo:
1590570334348 Urlbar.Tokenizer DEBUG hostPort: w
1590570334349 Urlbar.Tokenizer INFO Filtered Tokens: ["w"]
1590570334350 Urlbar.ProvidersManager DEBUG SkippableTimer :: Query provider timer :: Started
1590570334350 Urlbar.ProvidersManager INFO Queried 3 providers
1590570334352 Urlbar.Tokenizer DEBUG userinfo:
1590570334352 Urlbar.Tokenizer DEBUG hostPort: w
1590570334401 Urlbar.ProvidersManager DEBUG SkippableTimer :: Query provider timer :: Timed out!
1590570334401 Urlbar.Provider.PrivateSearch INFO Starting query for w
1590570334401 Urlbar.Provider.SearchSuggestions INFO Starting query for w
1590570334401 Urlbar.Provider.PrivateSearch INFO isPrivateEngine: false
1590570334401 Urlbar.Provider.PrivateSearch DEBUG SkippableTimer :: ProviderPrivateSearch :: Started
1590570334405 Urlbar.Provider.SearchSuggestions DEBUG SkippableTimer :: ProviderSearchSuggestions :: Started
1590570334502 Urlbar.Provider.PrivateSearch DEBUG SkippableTimer :: ProviderPrivateSearch :: Timed out!
1590570334503 Urlbar.ProvidersManager DEBUG SkippableTimer :: Query chunk timer :: Started
1590570334506 Urlbar.Provider.SearchSuggestions DEBUG SkippableTimer :: ProviderSearchSuggestions :: Timed out!
1590570334520 Urlbar.ProvidersManager DEBUG SkippableTimer :: Query chunk timer :: Timed out!
1590570334520 Urlbar.Muxer.UnifiedComplete DEBUG Buckets: heuristic,1,extension,5,suggestion,4,general,Infinity,suggestion,Infinity,general,Infinity
1590570334520 Urlbar.ProvidersManager DEBUG SkippableTimer :: Query chunk timer :: Canceling
1590570334520 Urlbar.ProvidersManager DEBUG SkippableTimer :: Query chunk timer :: Skipped
1590570334520 Urlbar.ProvidersManager DEBUG Cropping 0 results to 10
1590570334660 Urlbar.Muxer.UnifiedComplete DEBUG Buckets: heuristic,1,extension,5,suggestion,4,general,Infinity,suggestion,Infinity,general,Infinity
1590570334660 Urlbar.ProvidersManager DEBUG Cropping 1 results to 10
1590570334719 Urlbar.Muxer.UnifiedComplete DEBUG Buckets: heuristic,1,extension,5,suggestion,4,general,Infinity,suggestion,Infinity,general,Infinity
1590570334719 Urlbar.ProvidersManager DEBUG Cropping 2 results to 10
1590570334720 Urlbar.Muxer.UnifiedComplete DEBUG Buckets: heuristic,1,extension,5,suggestion,4,general,Infinity,suggestion,Infinity,general,Infinity
1590570334720 Urlbar.ProvidersManager DEBUG Cropping 3 results to 10
1590570334721 Urlbar.Muxer.UnifiedComplete DEBUG Buckets: heuristic,1,extension,5,suggestion,4,general,Infinity,suggestion,Infinity,general,Infinity
1590570334721 Urlbar.ProvidersManager DEBUG Cropping 4 results to 10
1590570334723 Urlbar.Muxer.UnifiedComplete DEBUG Buckets: heuristic,1,extension,5,suggestion,4,general,Infinity,suggestion,Infinity,general,Infinity
1590570334723 Urlbar.ProvidersManager DEBUG Cropping 5 results to 10
1590570334724 Urlbar.Muxer.UnifiedComplete DEBUG Buckets: heuristic,1,extension,5,suggestion,4,general,Infinity,suggestion,Infinity,general,Infinity
1590570334724 Urlbar.ProvidersManager DEBUG Cropping 6 results to 10
1590570334731 Urlbar.Muxer.UnifiedComplete DEBUG Buckets: heuristic,1,extension,5,suggestion,4,general,Infinity,suggestion,Infinity,general,Infinity
1590570334731 Urlbar.ProvidersManager DEBUG Cropping 7 results to 10
1590570334733 Urlbar.Muxer.UnifiedComplete DEBUG Buckets: heuristic,1,extension,5,suggestion,4,general,Infinity,suggestion,Infinity,general,Infinity
1590570334733 Urlbar.ProvidersManager DEBUG Cropping 8 results to 10
1590570334734 Urlbar.Muxer.UnifiedComplete DEBUG Buckets: heuristic,1,extension,5,suggestion,4,general,Infinity,suggestion,Infinity,general,Infinity
1590570334734 Urlbar.ProvidersManager DEBUG Cropping 9 results to 10
1590570334735 Urlbar.Muxer.UnifiedComplete DEBUG Buckets: heuristic,1,extension,5,suggestion,4,general,Infinity,suggestion,Infinity,general,Infinity
1590570334736 Urlbar.ProvidersManager DEBUG Cropping 10 results to 10
1590570334737 Urlbar.ProvidersManager INFO Query cancel w
1590570334737 Urlbar.Provider.UnifiedComplete INFO Canceling query for w
1590570334737 Urlbar.Provider.Interventions INFO Canceling query for w
1590570334737 Urlbar.Provider.PrivateSearch INFO Canceling query for w
1590570334737 Urlbar.Provider.SearchTips INFO Canceling query for w
1590570334737 Urlbar.Provider.SearchSuggestions INFO Canceling query for w
1590570334737 Urlbar.Provider.TokenAliasEngines INFO Canceling query for w
1590570334737 Urlbar.Provider.TopSites INFO Canceling query for w
1590570334737 Urlbar.ProvidersManager DEBUG SkippableTimer :: Query provider timer :: Skipped
1590570336422 Urlbar.EventBufferer DEBUG Clearing queue on blur
Assignee | ||
Comment 14•4 years ago
|
||
Thank you. We can see that the chunk timer is starting and timing out. We can also see that the muxer is called for each of the 10 results being added. And right around where the chunk timer starts and times out, we have logs from the private search provider. It looks like the private search provider is the first provider to add results: its internal timer times out and the next line logged is "Query chunk timer :: Started", i.e., the chunk timer is started (due to adding results).
That's helpful. It makes me remember that the muxer doesn't always include each result in the final list of results -- of course. It can exclude results. So I think I was basically right. What's likely happening is that the private search provider adds the private search result (and I see you're on Nightly, which is required for it) but the muxer excludes it (because the search also returns history for example), so the final context.results
on return from the first call to the muxer is empty.
The right fix is bailing when context.results
is empty after all.
Assignee | ||
Comment 15•4 years ago
|
||
Actually in this case the condition that causes the muxer to exclude the private search result is probably context.results.length > 1
, not the presence of history. The private search provider is the first provider to add results, and it only adds the one.
Assignee | ||
Comment 16•4 years ago
|
||
Comment 17•4 years ago
|
||
Comment 18•4 years ago
|
||
bugherder |
Description
•