firebase-tools:
ファイアベース: 7.1.1
ノード: v10.16.0
Java: 11.0.2
プラットホーム:
マックOS
これは、 dad143c42445056014f6f48cc9dfa13156e3c186 の firebase-tools/functionsEmulator.ts の行に表示され
、新しいトリガーを追加するリクエストは、リストに追加されるのではなく、追加された以前のトリガーを上書きします
curl ' http://localhost :9000/.settings/functionTriggers.json?ns=test-project' -X PUT -H 'authorization: Bearer owner' --data-binary '[{"name":"projects/test -project/locations/_/functions/NewPost","path":"/posts/{ownerId}/{postId}","event":"providers/google.firebase.database/eventTypes/ref.create"," topic":"projects/test-project/topics/NewPost"}]' -- 圧縮
{"ステータス":"OK"}
curl ' http://localhost :9000/.settings/functionTriggers.json?ns=test-project' -H 'authorization: Bearer owner' --compressed
[{"name":"projects/test-project/locations/_/functions/NewPost","path":"/posts/{ownerId}/{postId}","event":"providers/google.firebase. database/eventTypes/ref.create","topic":"projects/test-project/topics/NewPost"}]
curl ' http://localhost :9000/.settings/functionTriggers.json?ns=test-project' -X PUT -H 'authorization: Bearer owner' --data-binary '[{"name":"projects/test -project/locations/_/functions/UpdatePost","path":"/posts/{ownerId}/{postId}","event":"providers/google.firebase.database/eventTypes/ref.update"," topic":"projects/test-project/topics/UpdatePost"}]' -- 圧縮
{"ステータス":"OK"}
curl ' http://localhost :9000/.settings/functionTriggers.json?ns=test-project' -H 'authorization: Bearer owner' --compressed
[{"name":"projects/test-project/locations/_/functions/UpdatePost","path":"/posts/{ownerId}/{postId}","event":"providers/google.firebase. database/eventTypes/ref.update","topic":"projects/test-project/topics/UpdatePost"}]
両方のデータベース トリガーが追加され、データベース エミュレーターに一覧表示されます。
各呼び出しは前の呼び出しを上書きします
@gpfunk報告してくれてありがとう! 今すぐ調査して、再現できるか確認します。
これがバグであることを確認しました。次に、それがどこにあるのかを調べます。
神速:)
これは、「意図したとおりに機能しているが、まだバグ」の 1 つです。 基本的に、 firebase-tools
コード (お気づきのとおり) は、各関数のfunctionTriggers
リソース全体にPUT
を送信し、それを置き換えます。
本当に必要なのは、トリガー名を一意の ID として使用して呼び出すことができる RTDB エミュレーターに実装された「アップサート」操作です。 これが Firestore の特徴です。 今日はそれについて話し、うまくいけば解決策が得られると思います。
そうかもしれないと思いました、迅速なフィードバックに感謝します!
@IanWyszynskiは、「upsert」操作を試して追加しようとしています。