firebase / firebase/firebase-admin-java

NullPointerException when using cloud messaging

オープン
#1,081 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
needs-triage
主要言語
Java
スター
620
フォーク
305
平均マージ
3時間 23分
マージ済み PR(30日)
1

説明

* Library version: 9.4.3
* Firebase Product: cloud messaging

When we are sending messages in bulk to devices using device specific tokens, we randomly get the error below:

```
java.util.concurrent.ExecutionException: java.lang.NullPointerException
at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:595)
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:574)
at com.google.common.util.concurrent.FluentFuture$TrustedFuture.get(FluentFuture.java:91)
at com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:67)
at businessLayer.Messaging.sendPush(Messaging.java:777)
...
```

We are using the method sendEachAsync:
`BatchResponse firebaseResponse = FirebaseMessaging.getInstance(firebaseApp).sendEachAsync(firebaseMessages, pushDryRun).get();`

Besides the error showing up randomly when we are sending the messages, it seems that in older version of the library (<= 9.3.0), that the error is:

```
java.util.concurrent.ExecutionException: com.google.firebase.messaging.FirebaseMessagingException: com.google.firebase.messaging.FirebaseMessaging
at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:594)
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:573)
at com.google.common.util.concurrent.FluentFuture$TrustedFuture.get(FluentFuture.java:91)
at com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:67)
at businessLayer.Messaging.sendPush(Messaging.java:777)
...
```

The problem for us is that it seems that this error started showing up randomly last month.
At least some messages seem to be sent, because we have info that users are seeing and clicking on the notifications.
So, it seems that we are correctly calling the procedure.
Any help would be welcomed.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Messaging.java:777 の sendEachAsync 呼び出しと businessLayer.Messaging.sendPush から開始し、ライブラリバージョン 9.4.3 でデバイス固有のトークンへの一括送信を再現してください。非同期結果が以前の FirebaseMessagingException ではなく NullPointerException になる理由を追跡し、一括送信が対処可能なエラーを報告し、成功した通知には影響がないことを確認してください。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
firebase, java
領域
backend, cloud
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。