Closed
Bug 1145410
Opened 10 years ago
Closed 10 years ago
Recently-introduced error appearing soon after starting up (& early in reftest output): "JavaScript error: resource://gre/modules/NewTabUtils.jsm, line 1255: TypeError: Links._providers.get(...) is null"
Categories
(Firefox :: New Tab Page, defect)
Tracking
()
People
(Reporter: dholbert, Assigned: emtwo)
References
Details
(Whiteboard: .?)
Attachments
(1 file)
STR:
1. Run ./mach reftest layout/reftests/reftest-sanity/
(or any other mach reftest command)
2. Inspect the first few lines of terminal output.
ACTUAL RESULTS: Mixed in with the first test result, you'll see something like this:
> 0:09.98 JavaScript error: resource://gre/modules/NewTabUtils.jsm, line 1255: TypeError: Links._providers.get(...) is null
> 0:09.98 JavaScript error: resource://gre/modules/NewTabUtils.jsm, line 1255: TypeError: Links._providers.get(...) is null
Looks like this was likely introduced by bug 1126184, which recently modified NewTabUtils.jsm and added a call to Links._providers.get():
http://hg.mozilla.org/mozilla-central/rev/dab6b12a0ff6#l3.247
Reporter | ||
Comment 1•10 years ago
|
||
I also hit this during a normal browser session -- it's not just a reftest-harness issue.
e.g. I just performed these STR:
1. Start Firefox with a fresh profile, pointed at about:blank.
Specifically, I ran this command, on linux:
mkdir /tmp/foo; ./dist/bin/firefox -profile /tmp/foo -no-remote about:blank
2. Type "google.com" into URL bar and hit enter.
3. Watch your terminal while google is loading.
With those steps, I see 3 instances of this JS error go by, while Google loads.
Marina, I think this indicates that something from bug 1126184's patch isn't working as expected. Any chance you can take a look?
Flags: needinfo?(msamuel)
Summary: reftest runs now trigger "JavaScript error: resource://gre/modules/NewTabUtils.jsm, line 1255: TypeError: Links._providers.get(...) is null" → Recently-introduced error appearing soon after starting up (& early in reftest output): "JavaScript error: resource://gre/modules/NewTabUtils.jsm, line 1255: TypeError: Links._providers.get(...) is null"
Assignee | ||
Comment 2•10 years ago
|
||
Thanks for pointing this out, Daniel. I will investigate.
Assignee: nobody → msamuel
Flags: needinfo?(msamuel)
Assignee | ||
Comment 3•10 years ago
|
||
So it looks like there were a couple of things happening here:
1) If a user starts up a browser with their default newtab page pref to be 'blank' (aka not enabled), then the provider cache won't be populated and every time a page is loaded we look at the cache (to check if we need to update a suggested tile) and this error was thrown.
2) In the reftests, new pages were being open before the cache had finished populating.
In both cases once the cache finishes populating later on, we'll attempt to choose the suggested link again. So it's safe to treat the cache as empty even if it's mid-population.
Attachment #8580870 -
Flags: review?(adw)
Comment 4•10 years ago
|
||
Comment on attachment 8580870 [details] [diff] [review]
v1: Return valid results when querying the provider cache while it's empty or being populated
Review of attachment 8580870 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks, Marina.
::: toolkit/modules/NewTabUtils.jsm
@@ +1249,5 @@
>
> getProviderLinks: function(aProvider) {
> + let cache = Links._providers.get(aProvider);
> + if (cache && cache.sortedLinks) {
> + return Links._providers.get(aProvider).sortedLinks;
return cache.get(aProvider).sortedLinks;
@@ +1257,5 @@
>
> isTopSiteGivenProvider: function(aSite, aProvider) {
> + let cache = Links._providers.get(aProvider);
> + if (cache && cache.siteMap) {
> + return Links._providers.get(aProvider).siteMap.has(aSite);
return cache.get(aProvider).siteMap...
Attachment #8580870 -
Flags: review?(adw) → review+
Assignee | ||
Comment 5•10 years ago
|
||
Comment 6•10 years ago
|
||
Status: NEW → RESOLVED
Closed: 10 years ago
status-firefox39:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 39
Updated•10 years ago
|
Comment 7•10 years ago
|
||
status-firefox38:
--- → fixed
Comment 8•10 years ago
|
||
I'm not seeing this JS error using the STR provided by Daniel in comment 2 on Ubuntu 14.04 64-bit using:
- Firefox 38 beta 2, build ID: 20150406174117
- latest Aurora, build ID: 20150408004004
You need to log in
before you can comment on or make changes to this bug.
Description
•