Summarize the given content. I'm not sure what is happening exactly. I have an Angular…
- User
Summarize the given content.
I'm not sure what is happening exactly. I have an Angular app which connects to a firebase DB. Everything works fine, it fetches some data without problems. However, when I throttle the network to 'offline' in the devtools network tab, I suddenly see failed network requests repeatedly popping up, even though there were no pending or failed requests before toggling to 'offline'.Upon closer inspection, I see that the request URL of these requests start with https://firestore.googleapis.com/google.firestore.v1.Firestore/Listen/channel?[...] where the word 'Listen' is noticeable. I wonder if this is some kind of websocket/polling thing?The request to get data on this page is done by the following code: this.db.collection(this.observationsPath).valueChanges();;where this.db is an instance of AngularFirestore imported from '@angular/fire/firestore'.Alternatively I tried this.db.collection(this.observationsPath).snapshotChanges();Why does this happen and how can I stop it? The docs don't really help, they're incredibly confusing and uninformative to things like these.
- Assistant
The user has an Angular application that connects to a Firebase database and fetches data successfully. However, when they simulate an 'offline' network condition using the browser's devtools, they notice repeated failed network requests related to Firestore, specifically those with the URL starting with "https://firestore.googleapis.com/google.firestore.v1.Firestore/Listen/channel". The user suspects these requests might be linked to WebSocket or polling mechanisms. They are using the
valueChanges()andsnapshotChanges()methods to retrieve data from the database but are confused about the failed requests and seek guidance on how to stop them, noting that the documentation is unclear and unhelpful.