Closed Bug 806965 Opened 7 years ago Closed 7 years ago
B2G Network Manager: navigator
.on Line starts true even if false
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4 Steps to reproduce: Once the device boots and connection is offline by default Actual results: navigator.onLine returns true Expected results: navigator.onLine returns false. Only after connecting and disconnecting does the property return false as expected.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Does this impact WiFi connections for users or is it just the flag that is off?
Just a flag
It's critical though to Evme. When Evme thinks it's connected but really isn't - neither results nor an appropriate message are displayed.
Component: Gaia → General
Fixing this is also needed for FB integration. UX has advised to disable FB options is the user is not onLine.
(In reply to Ran Ben Aharon (everything.me) from comment #2) > Just a flag This is exactly a flag but also a HTML5 feature. With navigator.onLine the web gains the status of network connection and then could do something specially if they knows they are at offline mode now.
Many thanks to Andrea for helping me look at this yesterday.
The actual fix here is pretty straightforward: nsIOService assumes that we're online until told otherwise. Bug 552829 added notifications to tell child processes that when the online/offline state changed, however didn't do anything to initialize the state on process startup. There are two questions of taste to address though: is calling a Recv method directly poor form? I named the new state getter pretty generically. I could rename it to something more specific until we're sure we have to add other stuff to it.
Attachment #679803 - Flags: review?(justin.lebar+bug)
Comment on attachment 679803 [details] [diff] [review] Proposed fix Written just for you: https://wiki.mozilla.org/B2G/Hacking#Git Anyway, this seems fine to me. Maybe ask cjones if he's OK delegating the review to me? I don't have explicit review powers here.
Attachment #679803 - Flags: review?(justin.lebar+bug) → review+
(I spoke to cjones and he was fine with jlebar reviewing here). https://hg.mozilla.org/integration/mozilla-inbound/rev/efb2dca44965
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.