Closed Bug 962229 Opened 6 years ago Closed 6 years ago
JS Error on startup - DOMApplication
Registry: DOMApplication Registry: Could not read from json file /data/data/org .mozilla .fennec/files/mozilla/webapps/webapps .json
Synthetic APKs are still disabled on Nightly builds, so this shouldn't be the result of synthetic APKs (which in any case landed back on January 9). But Marco has made three subsequent changes to Webapps.jsm; perhaps one of those caused this problem? cc:ing folks.
Confirmed by reverting revision <http://hg.mozilla.org/mozilla-central/rev/75a010e3f038> that this is a regression from bug 959420.
Note that I see this on firstrun but not on subsequent run.
These are actually spurious error messages. loadCurrentRegistry used to check that the registry file exists before trying to load it, but now it just tries to load it, which results in NS_ERROR_FILE_NOT_FOUND on Fennec firstrun. Nevertheless, _loadJSONAsync should return early after it determines that the channel could not be fetched, like it used to. Instead, it now tries to read from the stream anyway, resulting in NS_BASE_STREAM_CLOSED. So the first fix in this patch is to return early in that case. But that still doesn't suppress the first spurious message. To fix that, we could make loadCurrentRegistry call OS.File.exists() to ensure the file exists before loading it, but I hear OS.File is slow to load and shouldn't be on the startup path. Plus OS.File.exists() has this performance note: Performance note: For the sake of performance, you should avoid this function whenever possible. For instance, rather than calling exists() to determine if a directory should be created with makeDir, you should rather create the directory with makeDir and catch the error if the directory exists. This will ensure that you only need to perform one I/O operation rather than two. So the second fix in this patch is to check the result of NetUtil.asyncFetch and suppress the error message if it's NS_ERROR_FILE_NOT_FOUND.
Assignee: nobody → myk
Status: NEW → ASSIGNED
Attachment #8363470 - Flags: review?(fabrice)
Attachment #8363470 - Flags: review?(fabrice) → review+
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 29
You need to log in before you can comment on or make changes to this bug.