firebase / firebase/firebase-admin-java

NullPointerException when using cloud messaging

Aperta
#1,081 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
needs-triage
Lingua principale
Java
Stelle
620
Fork
305
Merge medio
3h 23m
PR unite (30g)
1

Descrizione

* 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.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Partite dalla chiamata a sendEachAsync e da businessLayer.Messaging.sendPush in Messaging.java:777, quindi riproducete un invio in blocco a token specifici per dispositivo con la versione 9.4.3 della libreria. Tracciate il motivo per cui il risultato asincrono diventa una NullPointerException invece della precedente FirebaseMessagingException e verificate che gli invii in blocco riportino un errore utilizzabile, mentre le notifiche riuscite rimangono inalterate.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
firebase, java
Ambito
backend, cloud
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.