[Captive Portal] JS Error if the network error happen while fetching captive portal detection web page



Firefox OS
5 years ago
5 years ago


(Reporter: schien, Assigned: schien)


Firefox Tracking Flags

(Not tracked)



(3 attachments)

The following JS error shows in logcat with default captive portal detection site point to http://localhost/test.html
E/GeckoConsole(  771): [JavaScript Error: "self._runningRequest is null" {file: "jar:file:///system/b2g/omni.ja!/components/captivedetect.js" line: 301}]

Root Cause:
XMLHttpRequest.onreadystatechange() will still be invoked with readyState == DONE and status == 0 before onerror(), therefore, the retry mechanism will have this error since related attributes are cleaned up by onerror().
Is this worth noming for shira? What's the user impact here if this isn't fixed?
(In reply to Jason Smith [:jsmith] from comment #1)
> Is this worth noming for shira? What's the user impact here if this isn't
> fixed?
The retry mechanism for captive portal detection will not take effect under a sophisticated test case. User is not impacted by this JS error in their daily use. However, I already came out a simple patch for resolving this bug and I'd like to ship the captive portal detection in an error-free state.
Created attachment 711741 [details] [diff] [review]
Do not invoke onredirectorerror callback while network failure

For network failure on XMLHttpRequest, onreadystatechange will still be invoked with readyState = 4 and status = 0 prior to onerror callback. We should not invoke the onredirectorerror callback and should let onerror callback handle it.
Attachment #711741 - Flags: review?(tlee)
Created attachment 711742 [details] [diff] [review]
Test case

xpcshell test case for reproducing this scenario.
Created attachment 712592 [details]
logcat from simple disconnect/reconnect/launch Marketplace scenario

Are we saying most normal users won't see this?  In my case (a simple scenario), I:

1. Disconnected from Mozilla Guest
2. Reconnected
3. Launched Marketplace

In our automation, too, we see:

E/GeckoConsole(  109): [JavaScript Error: "self._runningRequest is null" {file: "jar:file:///system/b2g/omni.ja!/components/captivedetect.js" line: 301}]

quite often - could there be anything else that caused this failure to launch Marketplace?

E/GeckoConsole(  109): Content JS WARN at app://system.gaiamobile.org/js/window.js:40 in anonymous: app of [https://marketplace.firefox.com/telefonica/] got a mozbrowsererror event.
(In reply to Stephen Donner [:stephend] from comment #5)

I spun this off as bug 840612.
Attachment #711741 - Flags: review?(tlee)
Patches were merged with original modification of captive portal detection in bug 752982. This one can be closed without any further modification.
Last Resolved: 5 years ago
Resolution: --- → WORKSFORME
See Also: → bug 752982
You need to log in before you can comment on or make changes to this bug.