[firebase_ai] Live sessions on web don't send the App Check token
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 領域
- api, authentication
調査の方向性
Start with lib/src/live_session.dart and live_model.dart, then check how web WebSocket connections can pass Firebase App Check and Auth tokens and whether the backend accepts them in the query or setup message. Reproduce the reported Chrome connection with App Check enforced; done means Live sessions send the required tokens on web and the server no longer closes them with code 1008.
索引モデルが issue の本文から書いたものです。
説明
Bug
On web, a LiveGenerativeModel session doesn't send the App Check token, so when App Check is enforced for Firebase AI Logic the server closes every Live session right after it connects:
WebSocket Closed, closeCode: 1008, closeReason: Firebase App Check token is invalid.
Non-Live requests in the same app pass App Check with the same token.
Cause
LiveSession._defaultConnector in lib/src/live_session.dart drops the headers on web:
static WebSocketChannel _defaultConnector(
Uri uri, Map<String, String> headers) =>
kIsWeb
? WebSocketChannel.connect(uri)
: IOWebSocketChannel.connect(uri, headers: headers);
live_model.dart builds those headers with BaseModel.firebaseTokens(...), so the X-Firebase-AppCheck header (and the Auth token) only reach the server on native platforms. On web the token is in neither the URL (only ?key=) nor the setup message. Browsers can't set headers on a WebSocket, so the token needs to travel another way, for example as a query parameter or in the setup message, if the backend accepts one.
Same code in firebase_ai 3.15.0, 4.0.0, 5.0.0 and 5.1.0.
Repro
- Enforce App Check for Firebase AI Logic and register a web debug token.
- On Chrome, connect a Live session, for example
FirebaseAI.googleAI().liveGenerativeModel(model: 'gemini-3.8-live')andconnect(). - The server closes the socket with 1008 "Firebase App Check token is invalid".
Seen with the Gemini Developer API and with Agent Platform (us-central1). Found through the Genkit Firebase AI plugin: genkit-ai/genkit-dart#730.
Versions
firebase_ai 5.1.0, Flutter 3.47.9, Chrome.
- 主要言語
- Dart
- スター
- 9.3k
- フォーク
- 4.1k
- 平均マージ
- 2日 10時間
- マージ済み PR(30日)
- 78
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
firebase/flutterfire のほかの issue
-
🚀 [firebase_core] Bump Firebase C++ SDK (14.1.0 → 14.2.0)対応中かも @SelaseKay が今日担当しました。 オープンNeeds Attention type: enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
firebase/flutterfire#18977 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[firebase_core_web]: Firebase.initializeApp never completes when a Firebase JS SDK script fails to load対応中かも @LasseLegarth が 5 日前に担当しました。 オープンNeeds Attention platform: web plugin: core reproduced type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
firebase/flutterfire#18964 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Needs Attention platform: android plugin: crashlytics type: enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
firebase/flutterfire#18951 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
[cloud_firestore][Windows] Invalid field names (empty or `__x__`) close the app instead of throwing a FirebaseException対応中かも @SelaseKay が 5 日前に担当しました。 オープンNeeds Attention platform: windows plugin: cloud_firestore reproduced type: bug type: crash
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
firebase/flutterfire#18928 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Needs Attention plugin: ai type: enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 67/100
firebase/flutterfire#18917 ·
メンテナーはふだん 1 日以内に返信
firebase/flutterfire の issue をすべて見る
似ている issue
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
-
agent: is checked on a wrapper holding several checkables answers from the first one in tree orderオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
AlphaWaveSystems/flutter-probe#865 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
ubuntu/app-center#2306 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
spotiflacapp/SpotiFLAC-Mobile#923 ·