firebase / firebase/firebase-admin-java

NullPointerException when using cloud messaging

Abierto
#1,081 3 comentarios 0 reacciones 0 asignados Ver en GitHub
needs-triage
Lenguaje dominante
Java
Estrellas
620
Forks
305
Merge medio
3 h 23 min
PR fusionados (30 d)
1

Descripción

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

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comience con la llamada a sendEachAsync y businessLayer.Messaging.sendPush en Messaging.java:777; después, reproduzca un envío masivo a tokens específicos de dispositivos con la versión 9.4.3 de la biblioteca. Siga el motivo por el que el resultado asíncrono se convierte en una NullPointerException en lugar de la FirebaseMessagingException anterior, y verifique que los envíos masivos informen de un error accionable mientras las notificaciones correctas no se vean afectadas.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
firebase, java
Área
backend, cloud
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.