Gabriel Bessa
Gabriel Bessa

Reputation: 478

"Stream removed" error in Firebase Functions/Firestore

I created a project using firebase, cloud functions and firestore as db, but I am getting "Stream removed" error sporadically. This error happens when I am executing the function bellow:

exports.createUser = functions.auth
  .user()
  .onCreate(event => {
    const user = event.data;
    const registrationDate = new Date().getTime();
    const {uid, email, displayName, photoURL} = user;

    const userRelevantInfo = {
      ...
    };

    return usersRef.doc(uid).set(userRelevantInfo);
  });

Using "setLogFunction" from firestore, this is what gets logged:

Logs from firestore

Does anyone knows what is happening or how can I fix this?

Upvotes: 1

Views: 556

Answers (1)

Eystein Bye
Eystein Bye

Reputation: 5126

I had the same issue the last few days. I reported it to Firebase and they have fixed the issue. Update @google-cloud/firestore to version 0.10.1 (just released). This fixed the issue for me.

Admin Node 5.6.0 was also just released, which uses the latest Firestore as well.

Upvotes: 1

Related Questions