[cloud_firestore_web] Regression in 6.10.0: Document snapshot streams stall on Web after authentication state transition
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
Direzione di ricerca
Reproduce the Flutter Web regression with cloud_firestore 6.10.0 and firebase_core_web 3.12.0, then compare it with the working 6.9.0 and 3.11.0 versions. Start from the logged WebChannel and stream paths in webchannel_connection.ts, remote_store.ts, persistent_stream.ts, and sync_engine_impl.ts; done means authenticated snapshots emit initial and subsequent events without the stream hanging.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Is there an existing issue for this?
- I have searched the existing issues.
Which plugins are affected?
Cloud Functions, Database
Which platforms are affected?
Web
Description
Description
Following the update from cloud_firestore: 6.9.0 (firebase_core_web: 3.11.0) to cloud_firestore: 6.10.0 (firebase_core_web: 3.12.0), Firestore document snapshot streams (doc(...).snapshots()) fail to emit data or deliver snapshot events on Flutter Web.
Native platforms (macOS / iOS / Android) are unaffected and continue to work as expected.
Pinning cloud_firestore: 6.9.0 (and firebase_core_web: 3.11.0) immediately resolves the issue without any changes to application code.
Reproducing the issue
- Configure a Flutter Web application with
cloud_firestore: 6.10.0andfirebase_auth: 6.7.0(orfirebase_core_web: 3.12.0). - Authenticate a user via Firebase Auth (e.g., custom token or standard provider).
- Listen to a document snapshot stream:
FirebaseFirestore.instance .collection('users') .doc(userId) .snapshots() .listen((snapshot) { print('Received snapshot: ${snapshot.data()}'); }); - Observe network activity in Chrome DevTools:
- WebChannel establishes an initial handshake (
Listen/channel). - Following the auth state transition, the unauthenticated WebChannel session is terminated (
TYPE=terminate/ aborted GET long-poll withUnknown SID). - The subsequent snapshot listener on the authenticated session never emits events to the Dart stream listener; the stream hangs indefinitely with no error or data emitted.
Expected Behavior
snapshots() should emit document snapshots when listening to accessible documents on Flutter Web, matching the behavior in cloud_firestore: 6.9.0.
Actual Behavior
The stream hangs and never emits the initial document snapshot or subsequent updates. No error is thrown through .handleError().
Firebase Core version
4.15.0
Flutter Version
3.47.2
Relevant Log Output
// 1. Initial WebChannel Listen handshake and subscription registration (Pre-Auth / Transition)
webchannel_connection.ts:317 Fetch finished loading: POST "https://firestore.googleapis.com/google.firestore.v1.Firestore/Listen/channel?VER=8&database=projects%2F<PROJECT_ID>%2Fdatabases%2F(default)&RID=36868&CVER=22&X-HTTP-Session-Id=gsessionid&zx=o6xdvuy44xqx&t=1"
(anonymous) @ stream_controller.dart:618
(anonymous) @ js_allow_interop_patch.dart:367
__PRIVATE_onWatchStreamOpen @ remote_store.ts:572
(anonymous) @ persistent_stream.ts:532
then @ async_queue_impl.ts:137
// 2. Target added to listen to document snapshot
webchannel_connection.ts:333 Fetch finished loading: POST "https://firestore.googleapis.com/google.firestore.v1.Firestore/Listen/channel?VER=8&database=projects%2F<PROJECT_ID>%2Fdatabases%2F(default)&gsessionid=<GSESSION_ID>&SID=Xe1mhnSSZdjYxYx5OqJXQw&RID=36869&AID=1&zx=6iucu6uk4c7m&t=1"
(anonymous) @ stream_controller.dart:618
(anonymous) @ js_allow_interop_patch.dart:367
asyncQueue @ firestore_client.ts:528
// 3. User authenticates via Firebase Auth. Unlisten / session teardown triggered:
__PRIVATE_syncEngineImpl @ sync_engine_impl.ts:482
__PRIVATE_eventManagerUnlisten @ event_manager.ts:271
fromCache @ firestore_client.ts:795
then @ async_queue_impl.ts:137
// 4. In-flight WebChannel long-poll GET is terminated / aborted:
webchannel_connection.ts:317 Fetch failed loading: GET "https://firestore.googleapis.com/google.firestore.v1.Firestore/Listen/channel?gsessionid=<GSESSION_ID>&VER=8&database=projects%2F<PROJECT_ID>%2Fdatabases%2F(default)&RID=rpc&SID=Xe1mhnSSZdjYxYx5OqJXQw&AID=0&CI=0&TYPE=xmlhttp&zx=x6izydofjgit&t=1"
(anonymous) @ webchannel_blob_es2018.js:49
(anonymous) @ webchannel_blob_es2018.js:57
Eb @ webchannel_blob_es2018.js:25
// 5. Querying the terminated SID endpoint returns 400 Bad Request:
// HTTP/2 400 Bad Request
// <!DOCTYPE html>
// <html lang=en><title>Error 400 (Bad Request)!!1</title>
// <p><b>400.</b> <ins>That’s an error.</ins>
// <p>Your client has issued a malformed or illegal request. Unknown SID <ins>That’s all we know.</ins>
// 6. Result:
// The authenticated snapshot stream listener fails to deliver events to the Dart StreamSubscription.
// Document exists and is readable via authenticated REST API, but Stream<DocumentSnapshot> hangs indefinitely.
Flutter dependencies
-
Failing Versions:
cloud_firestore: 6.10.0cloud_firestore_web: 5.7.4(or transitive5.7.3withfirebase_core_web: 3.12.0)firebase_core_web: 3.12.0(bundled Firebase JS SDK12.19.0)
-
Working Versions:
cloud_firestore: 6.9.0cloud_firestore_web: 5.7.3firebase_core_web: 3.11.0(bundled Firebase JS SDK12.18.0)
Additional context and comments
-
In Chrome DevTools Network panel, the previous WebChannel long-polling channel aborts when authentication completes, and any subsequent poll to the terminated session ID returns
400 Bad Request (Unknown SID). -
Verified via authenticated Firestore REST API (
GET https://firestore.googleapis.com/v1/projects/<PROJECT>/databases/(default)/documents/...) that the target document exists and security rules permit read access with the active auth token. -
Reverting solely the FlutterFire dependencies back to
cloud_firestore: 6.9.0andfirebase_core_web: 3.11.0(Firebase JS SDK12.18.0) restores stream emissions immediately.
- Lingua principale
- Dart
- Stelle
- 9.3k
- Fork
- 4.1k
- Merge medio
- 1g 14h
- PR unite (30g)
- 39
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di firebase/flutterfire
-
Needs Attention platform: windows plugin: cloud_firestore reproduced type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
firebase/flutterfire#18735 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[cloud_firestore]: a snapshots() listener cancelled while it registers is never removed nativelyApertaNeeds Attention platform: android platform: ios platform: macos plugin: cloud_firestore reproduced type: bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
firebase/flutterfire#18724 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Needs Attention platform: ios plugin: messaging reproduced type: bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 74/100
firebase/flutterfire#18699 · 4 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
blocked: flutter platform: windows plugin: storage reproduced type: bug
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
firebase/flutterfire#18664 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[core] Decouple platform_interface from Flutter for pure-Dart webForse già presa @Lyokone l’ha presa 13 giorni fa. ApertaNeeds Attention platform: all platform: web plugin: core type: enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
firebase/flutterfire#18645 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di firebase/flutterfire
Issue simili
-
Smart charging: USB charger re-assert is starved during BLE scans, so the tablet never dischargesApertabug ready-for-agent
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
decentespresso/decaid#931 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
flame-engine/flame#4067 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
mrgnhnt96/zonai#37 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
google/skills_lint.dart#58 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
nvim-flutter/flutter-tools.nvim#557 ·
I maintainer di solito rispondono entro 1 giorno