Azure/azure-notificationhubs-java-backend

[BUG] sendDirectNotification for batch of devices is returning 500 status for FCM notifications

tlopesPT opened this issue · 1 comments

Describe the bug
Using this SDK to send direct FCM (GCM) notifications to devices, both the sync and async methods for a single device handle are working fine.

However, the send direct notification for a list of device handles (batch) is consistently returning a 500, sync and async.

Initially the Notification hub instance was on the Free tier, so I assumed that was the problem and upgraded to Basic tier.
However it's been about 1h after the upgrade and the 500 error remains.

Exception or Stack Trace
com.windowsazure.messaging.NotificationHubsException: Tracking ID: 9137ed07-f7cf-42a7-98a3-71910413a1a4 Error: HTTP/2.0 500 Internal Server Error - 500Unknown error has occured. TrackingId:9137ed07-f7cf-42a7-98a3-71910413a1a4,TimeStamp:10/14/2022 4:10:33 PM +00:00
at com.windowsazure.messaging.NotificationHubsException.create(NotificationHubsException.java:113)
at com.windowsazure.messaging.NotificationHubsService$1.completed(NotificationHubsService.java:69)
at com.windowsazure.messaging.NotificationHubsService$1.completed(NotificationHubsService.java:63)
at org.apache.hc.core5.concurrent.BasicFuture.completed(BasicFuture.java:123)
at org.apache.hc.core5.concurrent.ComplexFuture.completed(ComplexFuture.java:72)
at org.apache.hc.client5.http.impl.async.InternalAbstractHttpAsyncClient$1$3$1.completed(InternalAbstractHttpAsyncClient.java:298)
at org.apache.hc.core5.http.nio.support.AbstractAsyncResponseConsumer$1.completed(AbstractAsyncResponseConsumer.java:101)
at org.apache.hc.core5.http.nio.entity.AbstractBinAsyncEntityConsumer.completed(AbstractBinAsyncEntityConsumer.java:84)
at org.apache.hc.core5.http.nio.entity.AbstractBinDataConsumer.streamEnd(AbstractBinDataConsumer.java:81)
at org.apache.hc.core5.http.nio.support.AbstractAsyncResponseConsumer.streamEnd(AbstractAsyncResponseConsumer.java:142)
at org.apache.hc.client5.http.impl.async.HttpAsyncMainClientExec$1.streamEnd(HttpAsyncMainClientExec.java:233)
at org.apache.hc.core5.http2.impl.nio.ClientH2StreamHandler.consumeData(ClientH2StreamHandler.java:239)
at org.apache.hc.core5.http2.impl.nio.AbstractH2StreamMultiplexer$H2Stream.consumeData(AbstractH2StreamMultiplexer.java:1604)
at org.apache.hc.core5.http2.impl.nio.AbstractH2StreamMultiplexer.consumeDataFrame(AbstractH2StreamMultiplexer.java:1010)
at org.apache.hc.core5.http2.impl.nio.AbstractH2StreamMultiplexer.consumeFrame(AbstractH2StreamMultiplexer.java:728)
at org.apache.hc.core5.http2.impl.nio.AbstractH2StreamMultiplexer.onInput(AbstractH2StreamMultiplexer.java:444)
at org.apache.hc.core5.http2.impl.nio.AbstractH2IOEventHandler.inputReady(AbstractH2IOEventHandler.java:65)
at org.apache.hc.core5.http2.impl.nio.ClientH2IOEventHandler.inputReady(ClientH2IOEventHandler.java:39)
at org.apache.hc.core5.reactor.ssl.SSLIOSession.decryptData(SSLIOSession.java:594)
at org.apache.hc.core5.reactor.ssl.SSLIOSession.access$200(SSLIOSession.java:73)
at org.apache.hc.core5.reactor.ssl.SSLIOSession$1.inputReady(SSLIOSession.java:201)
at org.apache.hc.core5.reactor.InternalDataChannel.onIOEvent(InternalDataChannel.java:140)
at org.apache.hc.core5.reactor.InternalChannel.handleIOEvent(InternalChannel.java:51)
at org.apache.hc.core5.reactor.SingleCoreIOReactor.processEvents(SingleCoreIOReactor.java:178)
at org.apache.hc.core5.reactor.SingleCoreIOReactor.doExecute(SingleCoreIOReactor.java:127)
at org.apache.hc.core5.reactor.AbstractSingleCoreIOReactor.execute(AbstractSingleCoreIOReactor.java:85)
at org.apache.hc.core5.reactor.IOReactorWorker.run(IOReactorWorker.java:44)

To Reproduce

  • Setup a notification hub
  • Register a device
  • Send a direct notification to the device handle using the batch method

Code Snippet

  final SyncCallback<NotificationOutcome> callback = new SyncCallback<>();
  client.sendDirectNotificationAsync(notification, tokens, callback);
  callback.getResult();

Expected behavior
201 response, notification sent and received in device

Setup

  • OS: macOS 12.6 with M1 Pro
  • IDE : IntelliJ IDEA 2022.2.2 (Ultimate Edition)
  • com.windowsazure Notification-Hubs-java-sdk 1.0.3
  • JDK 17 (Eclipse Temurin)

Information Checklist

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added

Fixed the issue in #160