Error when accessing mozContacts api with developer mode enabled

RESOLVED WORKSFORME

Status

RESOLVED WORKSFORME
3 years ago
3 years ago

People

(Reporter: arcturus, Assigned: ferjm)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Having a profile with developer mode enabled, and installing a hosted app that access the mozContacts api, we find this error:

E/GeckoConsole(31282): [JavaScript Error: "NS_ERROR_NOT_IMPLEMENTED: SetNFCFocus for in-process mode is not yet supported" {file: "jar:file:///system/b2g/omni.ja!/components/BrowserElementParent.js" line: 907}]
Fabrice is this familiar to you?
Flags: needinfo?(fabrice)
That happens all the time, and is unrelated to the contacts api.
I'm not sure why we throw at https://mxr.mozilla.org/mozilla-central/source/dom/browser-element/BrowserElementParent.js#907 since we fail silently a few lines later.
Flags: needinfo?(fabrice)
Dimi, do we really need to throw there?
Flags: needinfo?(dlee)
Hi Fabrice,
Sure we can remove the throw.
But I would like to know why this error occurs, do we run in-process mode in this case ?

I try to install a hosted app and launch it and this issue is not reproduced.
Flags: needinfo?(dlee)
:dimi did you tried a hosted app, in developer mode accessing the mozContacts api?

Will provide a zip file with an example soon
Flags: needinfo?(dlee)
Hi,

here is an app with the problem:

https://github.com/borjasalguero/contacts_prototype/tree/sw

As it uses service workers, please server from a https domain.
The app itself doesn't install so you'll need to execute from the context of the app:

window.navigator.mozApps.install('https://<your domain>/manifest_hosted.webapp'); 

Once installed you'll be able to reproduce the problem:
I/Gecko   (  208): [Parent 208] WARNING: waitpid failed pid:5819 errno:10: file ../../../gecko/ipc/chromium/src/base/process_util_posix.cc, line 267
I/Gecko   (  208): [Parent 208] WARNING: pipe error (219): Connection reset by peer: file ../../../gecko/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 459
I/Gecko   (  208): 
I/Gecko   (  208): ###!!! [Parent][OnMaybeDequeueOne] Error: Channel error: cannot send/recv
I/Gecko   (  208): 
I/Gecko   (  208): 
I/Gecko   (  208): ###!!! [Parent][MessageChannel] Error: (msgtype=0x200079,name=PBrowser::Msg_Destroy) Channel error: cannot send/recv
I/Gecko   (  208): 
E/GeckoConsole(  208): [JavaScript Error: "NS_ERROR_NOT_IMPLEMENTED: SetNFCFocus for in-process mode is not yet supported" {file: "jar:file:///system/b2g/omni.ja!/components/BrowserElementParent.js" line: 907}]
I'm not sure why you call that a problem. It's a harmless warning that happens all the time when opening/closing apps.
Well, when we get:

E/GeckoConsole(  208): [JavaScript Error: "NS_ERROR_NOT_IMPLEMENTED: SetNFCFocus for in-process mode is not yet supported" {file: "jar:file:///system/b2g/omni.ja!/components/BrowserElementParent.js" line: 907}]

It's not completely harmless since it kills the app :(, or better said it doesn't even let the app start.
I forgot to mention, when using the example in:

https://github.com/borjasalguero/contacts_prototype/tree/sw

Please run to get the dependencies:
bower install
Could you create a smaller example that demonstrate this issue? Ideally host it on a https domain?
(Assignee)

Updated

3 years ago
Assignee: nobody → ferjmoreno
(Assignee)

Comment 11

3 years ago
This works for me. I can open the app and it shows the contacts that are stored in the mozContacts API. I also checked that the service worker is properly installed. I cannot add contacts though, the "+" button isn't enabled, but this might be something wrong with the app itself. I am closing this, if you still find the issue, please reopen it.
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Flags: needinfo?(dlee)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.