I try to fetch a firebase object and the request works well half of the
time, but sometimes I get this message in the log:

c:0:3: Primary connection is healthy.
p:0: from server: {"r":15,"b":{"s":"ok","d":{}}}
p:0: listen response {"s":"ok","d":{}}
p:0: from server: {"r":16,"b":{"s":"ok","d":""}}
p:0: p response {"s":"ok","d":""}
p:0: from server: {"r":17,"b":{"s":"ok","d":""}}
p:0: p response {"s":"ok","d":""}
p:0: from server: {"r":18,"b":{"s":"ok","d":""}}
p:0: m response {"s":"ok","d":""}
p:0: Browser went offline. Killing connection.
c:0:3: Closing realtime connection.
c:0:3: Shutting down all connections
c:0:3:0 Longpoll is being closed.
p:0: data client disconnected
0: onDisconnectEvents

And the request never terminates.



The app runs Angular 1.4, Ionic 1.1.0, AngularFire 1.1.3 and Firebase
2.2.9. The problem occurs on both Android and iPhone regardless of the
version.

My phone is on a good wifi to discard network related issues.

Here is the related JS code:

var facebookUid = '1213161789'; // result from the facebook native plugin
var ref = new Firebase(config.firebaseurl + '/users');
$firebaseObject(ref.child(facebookUid))
     .$loaded()
     .then(function(firebaseUser) {
        .... // sometimes called
     })
     .catch(function(firebaseUser) {
        .... // never called
     })
;

I tried to force long poll instead of web sockets but with no visible
changes. The problem originally happened with the plain Firebase object,
and switching to AngularFire didn't solved it.


It appears that navigator.online is true and when we try to force the
connection with Firebase.goOnline() the connection is not restored...


This maybe not related but:

    - According to the documentation, I also added the following to my
    config.xml
       - <allow-intent href="*.firebaseio.com" />
       - <allow-intent href="auth.firebase.com" />
    - And this line is in my index.html
       - <meta http-equiv="Content-Security-Policy" content="connect-src *">


--
You received this message because you are subscribed to the Google Groups "Firebase + AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-angular+unsubscribe@googlegroups.com.
To post to this group, send email to firebase-angular@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-angular/d0036905-d608-453a-b367-59cd7f7899a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Kato Richardson at Oct 6, 2015 at 4:43 pm
    Julien,

    This will undoubtedly be a sophisticated issue to troubleshoot and involve
    some combination of factors. Please provide a minimal, complete, verifiable
    example <http://stackoverflow.com/help/mcve> that we could run to see the
    issue.

    ☼, Kato
    On Tue, Oct 6, 2015 at 6:45 AM, Julien Desbois wrote:

    I try to fetch a firebase object and the request works well half of the
    time, but sometimes I get this message in the log:

    c:0:3: Primary connection is healthy.
    p:0: from server: {"r":15,"b":{"s":"ok","d":{}}}
    p:0: listen response {"s":"ok","d":{}}
    p:0: from server: {"r":16,"b":{"s":"ok","d":""}}
    p:0: p response {"s":"ok","d":""}
    p:0: from server: {"r":17,"b":{"s":"ok","d":""}}
    p:0: p response {"s":"ok","d":""}
    p:0: from server: {"r":18,"b":{"s":"ok","d":""}}
    p:0: m response {"s":"ok","d":""}
    p:0: Browser went offline. Killing connection.
    c:0:3: Closing realtime connection.
    c:0:3: Shutting down all connections
    c:0:3:0 Longpoll is being closed.
    p:0: data client disconnected
    0: onDisconnectEvents

    And the request never terminates.



    The app runs Angular 1.4, Ionic 1.1.0, AngularFire 1.1.3 and Firebase
    2.2.9. The problem occurs on both Android and iPhone regardless of the
    version.

    My phone is on a good wifi to discard network related issues.

    Here is the related JS code:

    var facebookUid = '1213161789'; // result from the facebook native plugin
    var ref = new Firebase(config.firebaseurl + '/users');
    $firebaseObject(ref.child(facebookUid))
    .$loaded()
    .then(function(firebaseUser) {
    .... // sometimes called
    })
    .catch(function(firebaseUser) {
    .... // never called
    })
    ;

    I tried to force long poll instead of web sockets but with no visible
    changes. The problem originally happened with the plain Firebase object,
    and switching to AngularFire didn't solved it.


    It appears that navigator.online is true and when we try to force the
    connection with Firebase.goOnline() the connection is not restored...


    This maybe not related but:

    - According to the documentation, I also added the following to my
    config.xml
    - <allow-intent href="*.firebaseio.com" />
    - <allow-intent href="auth.firebase.com" />
    - And this line is in my index.html
    - <meta http-equiv="Content-Security-Policy" content="connect-src
    *">

    --
    You received this message because you are subscribed to the Google Groups
    "Firebase + AngularJS" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to firebase-angular+unsubscribe@googlegroups.com.
    To post to this group, send email to firebase-angular@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/firebase-angular/d0036905-d608-453a-b367-59cd7f7899a8%40googlegroups.com
    <https://groups.google.com/d/msgid/firebase-angular/d0036905-d608-453a-b367-59cd7f7899a8%40googlegroups.com?utm_medium=email&utm_source=footer>
    .
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to firebase-angular+unsubscribe@googlegroups.com.
    To post to this group, send email to firebase-angular@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-angular/CADypTEbhhM6KjCdnfE0zty0vXLpoq6f52e1jyXwJQUxDO5mKPw%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Julien Desbois at Oct 6, 2015 at 5:06 pm
    Also posted on stackoverflow:
    http://stackoverflow.com/questions/32954476/firebase-random-slow-fetch-on-angular-ionic-app-android-and-iphone

    --
    You received this message because you are subscribed to the Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to firebase-angular+unsubscribe@googlegroups.com.
    To post to this group, send email to firebase-angular@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-angular/bbb63bf4-920b-4eb7-9fc8-b5a4011edb6c%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupfirebase-angular @
postedOct 6, '15 at 2:56p
activeOct 6, '15 at 5:06p
posts3
users2

2 users in discussion

Julien Desbois: 2 posts Kato Richardson: 1 post

People

Translate

site design / logo © 2021 Grokbase