Closed Bug 826297 Opened 12 years ago Closed 11 years ago

B2G navigator.onLine + online / offline events no longer working

Categories

(Core :: DOM: Device Interfaces, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla20
blocking-basecamp +
Tracking Status
firefox19 --- fixed
firefox20 --- fixed
firefox21 --- fixed
b2g18 --- fixed

People

(Reporter: philikon, Assigned: hub)

References

Details

(Keywords: regression)

Attachments

(1 file)

As reported by Jose M. Cantera in bug 777145 comment #40:
> It has stopped working. STR:
> 
> Gecko-257e1c1.Gaia Master
> 
> Go to Gaia and turn on / off airplane mode. The online / offline events are
> not raised over the window object. And the following JS error appears on the
> console
> 
> E/GeckoConsole(  717): [JavaScript Error: "NS_ERROR_NOT_AVAILABLE: Component
> returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE)
> [nsIPrefBranch.setIntPref]" {file:
> "jar:file:///system/b2g/omni.ja!/components/RILContentHelper.js" line: 878}]
> E/GeckoConsole(  768): [JavaScript Error: "NS_ERROR_NOT_AVAILABLE: Component
> returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE)
> [nsIPrefBranch.setIntPref]" {file:
> "jar:file:///system/b2g/omni.ja!/components/RILContentHelper.js" line: 878}]
The exception isn't caught on a call to
          Services.prefs.setIntPref("ril.lastKnownMcc", this.iccInfo.mcc);
I'll look at it.
Assignee: nobody → hub
blocking-basecamp: ? → ---
blocking-basecamp: --- → ?
Keywords: regression
Jonas Sicking for review as he reviewed the original change.
Attachment #697950 - Flags: review?(jonas)
Also I haven't been able to reproduce the problem.
Jonas, can you comment on the impact from this bug and why you think it should block basecamp?
Flags: needinfo?(jonas)
This is a very standard web feature which is particularly important on mobile since connectivity is often lost there. This is how we tell a website that it can't connect to the internet any more.

Without this we'll likely see more apps getting stuck with spinners trying to fetch server-side data rather than using cached local data or doing nothing.
Flags: needinfo?(jonas)
(In reply to Jonas Sicking (:sicking) from comment #6)
> This is how we tell a website
> that it can't connect to the internet any more.

That seems important enough to me to block on.
blocking-basecamp: ? → +
https://hg.mozilla.org/mozilla-central/rev/a55044631d14
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
this is not working with latest Gaia and Gecko 7e463c0
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(In reply to Jose M. Cantera from comment #11)
> this is not working with latest Gaia and Gecko 7e463c0

I'd be curious to see how you reproduce it.
Are u in the Berlin WW?
(In reply to Jose M. Cantera from comment #13)
> Are u in the Berlin WW?

Yes I am.
I reverted revesion 34a0dad8b495590ae6656ffef8f6c6823499cd5d and it works.

    Bug 820617 - Add a hook to make NetworkManager not manage offline status and use it in Marionette for B2G CI. r=jgriffin, a=blocking-basecamp
(In reply to Jose M. Cantera from comment #11)
> this is not working with latest Gaia and Gecko 7e463c0

Jose, I already told you in bug 777145 comment 41, please always open a new bug. Don't reopen a bug that has had a landed patch UNLESS that patch has been backed out.
Status: REOPENED → RESOLVED
Closed: 12 years ago11 years ago
Resolution: --- → FIXED
(In reply to Hub Figuiere [:hub] from comment #15)
> I reverted revesion 34a0dad8b495590ae6656ffef8f6c6823499cd5d and it works.
> 
>     Bug 820617 - Add a hook to make NetworkManager not manage offline status
> and use it in Marionette for B2G CI. r=jgriffin, a=blocking-basecamp

Do you guys have Marionette enabled on your phones? Marionette is typically enabled on eng builds, but not on user builds. Marionette needs to disable the automatic online/offline detection. That's what bug 820617 is about.

So I suggest you either switch to a user build. Or, if you want to remain on eng build which is perfectly reasonably, set the "marionette.defaultPrefs.enabled" pref to false to disable Marionette. You can do this in a number of ways:

  (a) modify https://mxr.mozilla.org/mozilla-central/source/b2g/app/b2g.js#446 and reflash Gecko
  (b) create gaia/build/custom-prefs.js, put the following line in it, and reflash Gaia.

    user_pref("marionette.defaultPrefs.enabled", false);

Hope this helps.
if I modify the prefs.js with b2g not running it get reset (ie the line removed) when I start b2g.
To modify it I adb pull / push with edit. And I use cat to verify the file has the right value. And it gets changed at one point during startup.

I haven't tried reset-gaia yet as I'd like to avoid that.
(In reply to Philipp von Weitershausen [:philikon] from comment #17)
> (In reply to Hub Figuiere [:hub] from comment #15)
> > I reverted revesion 34a0dad8b495590ae6656ffef8f6c6823499cd5d and it works.
> > 
> >     Bug 820617 - Add a hook to make NetworkManager not manage offline status
> > and use it in Marionette for B2G CI. r=jgriffin, a=blocking-basecamp
> 
> Do you guys have Marionette enabled on your phones? Marionette is typically
> enabled on eng builds, but not on user builds. Marionette needs to disable
> the automatic online/offline detection. That's what bug 820617 is about.
> 
> So I suggest you either switch to a user build. Or, if you want to remain on
> eng build which is perfectly reasonably, set the
> "marionette.defaultPrefs.enabled" pref to false to disable Marionette. You
> can do this in a number of ways:
> 
>   (a) modify
> https://mxr.mozilla.org/mozilla-central/source/b2g/app/b2g.js#446 and
> reflash Gecko
>   (b) create gaia/build/custom-prefs.js, put the following line in it, and
> reflash Gaia.
> 
>     user_pref("marionette.defaultPrefs.enabled", false);
> 
> Hope this helps.

Thanks Philikon, you are totally right. I enabled marionette to execute integration tests and that's why it stopped working.
Sorry for the noise

thanks
(In reply to Philipp von Weitershausen [:philikon] from comment #16)
> (In reply to Jose M. Cantera from comment #11)
> > this is not working with latest Gaia and Gecko 7e463c0
> 
> Jose, I already told you in bug 777145 comment 41, please always open a new
> bug. Don't reopen a bug that has had a landed patch UNLESS that patch has
> been backed out.

Sorry about that. I thought that the policy for reopening was how old was the concerned bug. 

thanks
I just installed a pure beta version of b2g and verified that the events are happening as expect and including the few other details that Jose showed me in person.
I filed bug 829576 to ask for a more friendly developer settings.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: