Firebase-js-sdk: [URGENT] Performance bug in Edge, Firefox

Created on 23 Jan 2018  路  17Comments  路  Source: firebase/firebase-js-sdk


Querying firestore collections and documents in Edge browser is either instant or with a 30s delay about every other time you load the app; Firefox fails completely.

[REQUIRED] Describe your environment

  • Operating System version: Windows 10
  • Firebase SDK version: 4.9.0
  • Firebase Product: firestore
  • Affected browsers: Edge 15+, Firefox 52+

[REQUIRED] Describe the problem

Steps to reproduce:

  1. create collection 'channels'
  2. apply read permissions to it
    match /channels/{document=**} { allow read; }
  3. connect to firestore by filling up database config in app/app.component.ts
  4. refresh the output window and observe how long it would take for the response to come. (might take few tries)

    Relevant Code:

https://stackblitz.com/edit/angular-xldoe5

firestore

Most helpful comment

You're welcome. :-) We believe everything should be fixed in our next release, targeted for Thursday. You can npm install firebase@next to get the prerelease bits for testing if you like.

All 17 comments

updated the sample stripping irrelevant code.
After few tests I can confirm this is not exclusive to collections, doc() has the same issue,

I've also seen some _serious_ performance issues with Edge also. Sometimes it is on par with Chrome (so almost instantaneous), and other times it is anywhere from 30s to 2min to forever.

Have not tested within Firefox. Chrome works and behaves perfectly. I suspect this has started more recently (in the past few months), either just due to the type of queries I've used more recently, or due to firestore/edge updates. I don't have the time to investigate which atm unfortunately.

For whoever this may help..
I have an issue with Edge on latest 4.11.0 firebase version. I have contacted google support team almost 3 months ago, and they are still investigating this. They asked for a simple project to validate that the issue is theirs and not another library, and whil investigating I noticed the following:

  1. When running firebase using webpack edge is almost always slow
  2. When using a

Ahh, thanks for pointing that out. I hadn't looked at your latest repro yet (I had independently found that using the CDN assets from gstatic didn't reproduce the problem). That is indeed interesting.

I think when you say "nodejs" you're probably generically referring to our npm package, but it actually contains both a browser version and a nodejs version: https://github.com/firebase/firebase-js-sdk/blob/563e048f17c756376a76a2f8b11ae7f9450eb9ff/packages/firebase/package.json#L26

And the two are quite different. Using the nodejs code in a browser wouldn't work at all. :-) As for the difference between the npm package code and the CDN code, that is a good question. They come from the same sources, but the CDN code is bundled and minified, etc.

I'll continue to investigate. Thanks.

I am also running into this issue with an updated version of firebase. Using the vanilla create-react-app, which does run webpack. This issue occurs for me every time in edge. https://youtu.be/lyPEY_F9nEs

Locally the call times out. When deployed here it takes about thirty seconds.

This is the call that is hanging for me:

    db.collection('users').doc(this.state.userId).get()
      .then((userDoc) => {
        const user = userDoc.data()
        if (user.assessments) {
          if (user.assessments[assessmentId]) {
            const userAssessmentId = user.assessments[assessmentId].userAssessmentId
            db.collection('userAssessments').doc(userAssessmentId).get()
              .then((userAssessmentDoc) => {
                const userAssessment = userAssessmentDoc.data()
                this.props.assessmentInitializeSuccess(userAssessment)
              })
              .catch((err) => this.props.assessmentInitializeError(err))
          } 
        }  
      })
      .catch((err) => this.props.assessmentInitializeError(err))

Let me know if you'd like to see more code for a repro.

So I think I figured out what's going on. This is the same bug that we investigated / fixed before (fixed by #509), but we didn't release a new version of @firebase/webchannel-wrapper... so if you're building with webpack you didn't get the fix. But if you used the prebuilt client (firebase-firestore.js) you did get the fix.

I'll work with @jshcrowthe to get this resolved.

One note though: The fix that was made is only applicable to Edge. If anybody is seeing issues with Firefox, please open a separate issue.

Awesome! Thx for all of your hard work!

Thanks so much for working through this! This is quite a big bug that I just stumbled upon when testing my application on Edge. Let me know if I can do anything to help 馃憤

You're welcome. :-) We believe everything should be fixed in our next release, targeted for Thursday. You can npm install firebase@next to get the prerelease bits for testing if you like.

I caught the issue on Firefox by suprise while testing the bug on browserstack. I'll run more tests and will close the issue if nothing else comes up.

Please wait until the new release is published :)

edge 15-16: pass;
firefox 52-57: 10s delay
firefox 58+: pass.

Since the latest version of firefox are passing the test will consider the issue to be fixed.

A similar problem is existing in Internet Explorer 11.
Does anyone know if this issue is beeing worked on?

This issue has been closed for months and I'm not aware of any active IE or Edge performance issues being tracked. Please open a new issue with as much detail as possible about what you're expecting and what you're seeing. Thanks!

Was this page helpful?
0 / 5 - 0 ratings