Skip to content

[BUG] Crash on NUGET #330

@harrypotter06

Description

@harrypotter06

Describe the bug
Crash is Send notification to fcmV1

Exception or Stack Trace
Error: Unhandled Exception
System.Exception: CurrentDomainOnUnhandledException
--->
Microsoft.Azure.NotificationHubs.Messaging.MessagingException: Unexpected exception encountered TrackingId:3ccc6775-0918-414d-904d-ab6630396339,TimeStamp:2024-09-28T19:33:25.7687821Z
--->
System.Net.Http.HttpRequestException: An error occurred while sending the request.
--->
System.Net.Http.HttpIOException: The response ended prematurely. (ResponseEnded)

at System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)

--- End of inner exception stack trace ---

at System.Net.Http.HttpConnection.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)

at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)

at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)

at System.Net.Http.HttpClient.g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)

at Microsoft.Azure.NotificationHubs.NotificationHubClient.SendRequestAsync(HttpRequestMessage request, String trackingId, HttpStatusCode[] successfulResponseStatuses, CancellationToken cancellationToken)

--- End of inner exception stack trace ---

at Microsoft.Azure.NotificationHubs.ExceptionsUtility.HandleUnexpectedException(Exception ex, String trackingId)

at Microsoft.Azure.NotificationHubs.NotificationHubClient.SendRequestAsync(HttpRequestMessage request, String trackingId, HttpStatusCode[] successfulResponseStatuses, CancellationToken cancellationToken)

at Microsoft.Azure.NotificationHubs.NotificationHubClient.<>c__DisplayClass203_0.<b__0>d.MoveNext()

--- End of stack trace from previous location ---

at Microsoft.Azure.NotificationHubs.NotificationHubRetryPolicy.d__4`1[[Microsoft.Azure.NotificationHubs.NotificationOutcome, Microsoft.Azure.NotificationHubs, Version=4.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]].MoveNext()

at Microsoft.Azure.NotificationHubs.NotificationHubRetryPolicy.d__4`1[[Microsoft.Azure.NotificationHubs.NotificationOutcome, Microsoft.Azure.NotificationHubs, Version=4.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]].MoveNext()

at Microsoft.Azure.NotificationHubs.NotificationHubClient.SendNotificationImplAsync(Notification notification, String tagExpression, String deviceHandle, CancellationToken cancellationToken)

at EU_Schwerbehinderung_Premium.BackHelpers.BW5AzureServices.SendRawNotificationAsync(String toast)

at EU_Schwerbehinderung_Premium.BackHelpers.GeofenceTransitionsIntentService.AlertSender()

at EU_Schwerbehinderung_Premium.BackHelpers.GeofenceTransitionsIntentService.GeofenceUpdatesCheck(Intent intent)
at System.Threading.Tasks.Task.<>c.b__128_1(Object state)

at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute()

at System.Threading.ThreadPoolWorkQueue.Dispatch()

at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()

--- End of inner exception stack trace ---

To Reproduce
NotificationHubClient hub;
string HUB_NAME = "MyHub";
string HUB_LISTEN_SECRET = "MySecret";
hub = new NotificationHubClient(HUB_LISTEN_SECRET, HUB_NAME);
var toast = MyTextMessage
var MyMessage = "{ 'message': { 'notification': { 'body' : '" + toast + "'} } }";
var PF_Message = hub.SendFcmV1NativeNotificationAsync(MyMessage);

Code Snippet
see To Reproduce

Expected behavior
sometimes it works, sometimes not - think NUGET es no Errorroutine, so it make a crash

Screenshots
If applicable, add screenshots to help explain your problem.

Setup (please complete the following information):

  • OS:Android 14
  • IDE : Visual Studio 2022
  • Version: 4.2.0

Additional context
Add any other context about the problem here.

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions