firebase / firebase/firebase-admin-java

NullPointerException when using cloud messaging

Aberta
#1,081 3 comentários 0 reações 0 responsáveis Ver no GitHub
needs-triage
Linguagem predominante
Java
Estrelas
620
Forks
305
Merge médio
3h 23min
PRs com merge (30d)
1

Descrição

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

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

Comece pela chamada sendEachAsync e por businessLayer.Messaging.sendPush em Messaging.java:777 e, em seguida, reproduza um envio em massa para tokens específicos de dispositivos usando a versão 9.4.3 da biblioteca. Rastreie por que o resultado assíncrono se torna uma NullPointerException em vez da FirebaseMessagingException anterior e verifique se os envios em massa relatam um erro acionável, enquanto as notificações bem-sucedidas permanecem inalteradas.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
firebase, java
Domínio
backend, cloud
Tipo de issue
Bug
Dificuldade
4/5
Tempo estimado
3-5 dias
Status de atividade
Estagnada
Clareza
Precisa de esclarecimento
Facilidade para iniciantes
35/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.