Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Synchronous XMLHttpRequest Deprecated

The ping service from Firebase is using Synchronous XMLHttpRequest which was reported by Google Chrome as follows:

Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/.

The source of this issue is coming from:

.lp?dframe=t&id=612050&pw=gcdpSrzjvk&ns=myapp:5

Is it a bug within Firebase? This isn't causing any issue for now. But in future, browsers may deprecate synchronous XHR.

like image 214
Mohammad Avatar asked Sep 08 '15 21:09

Mohammad


2 Answers

This error appears only for clients that fall back to long-polling.

You should only see it when you're closing the page, navigating away, or refreshing it.

The Firebase client choses to do a synchronous XHR to tell the server that it's disconnecting. This way the server can immediately run the logic you've specified on any onDisconnect() functions. Else, the client has to rely on a timeout, which can take a minute or two.

Likely you see this when the page refreshes and it's lingering in the console.

But, there's nothing to worry about, it's intentional and it's also harmless to your application.

like image 171
David East Avatar answered Sep 27 '22 20:09

David East


Yes, pretty sure this is a bug with Firebase. More specifically, I'm pretty sure this has to do with Firebase's service status. I consistently get this error any time there are intermittent service outages (which Firebase Support has subsequently acknowledged), then when the service is restored, the error no longer happens (presumably because WebSockets are working again, so the Firebase client is no longer falling back to XHR polling).

Also FWIW it seems to happen more frequently when developing locally than on live production servers, which hopefully means Firebase is prioritizing traffic properly.

like image 32
Evan Schneyer Avatar answered Sep 27 '22 22:09

Evan Schneyer