Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] MessagingEntityNotFoundException when getting notification outcome details #299

Open
3 tasks done
Solethia opened this issue Oct 11, 2023 · 0 comments
Open
3 tasks done

Comments

@Solethia
Copy link

Solethia commented Oct 11, 2023

Describe the bug
When getting notification outcome details a MessagingEntityNotFoundException is thrown for some notifications even after waiting 30 or more minutes after the notification was enqueued.

Exception or Stack Trace

Microsoft.Azure.NotificationHubs.Messaging.MessagingEntityNotFoundException
   at Microsoft.Azure.NotificationHubs.NotificationHubClient.<SendRequestAsync>d__201.MoveNext()
   at Microsoft.Azure.NotificationHubs.NotificationHubClient.<SendRequestAsync>d__200.MoveNext()
   at Microsoft.Azure.NotificationHubs.NotificationHubClient.<>c__DisplayClass80_0.<<GetNotificationOutcomeDetailsAsync>b__0>d.MoveNext()
   at Microsoft.Azure.NotificationHubs.NotificationHubRetryPolicy.<RunOperation>d__4`1.MoveNext()
   at Microsoft.Azure.NotificationHubs.NotificationHubRetryPolicy.<RunOperation>d__4`1.MoveNext()
   at Microsoft.Azure.NotificationHubs.NotificationHubClient.<GetNotificationOutcomeDetailsAsync>d__80.MoveNext()
   at [Redacted].Queues.Triggers.LoyaltyNotificationOutcomeTrigger.<TryGetNotificationDetails>d__10.MoveNext() 
   
   in C:\Users\[Redacted]\source\repos\[Redacted]\[Redacted]\[Redacted].Queues\Triggers\LoyaltyNotificationOutcomeTrigger.cs:line 119

To Reproduce

  1. Use Microsoft.Azure.NotificationHubs nuget package version 4.1.0.
  2. Ensure hub namespace set to standard pricing
  3. Send notification Microsoft.Azure.NotificationHubs.NotificationHubClient.SendFcmNativeNotificationAsync(string jsonPayload, IEnumerable<string> tags) or Microsoft.Azure.NotificationHubs.NotificationHubClient.SendNotificationAsync(Notification notification, IEnumerable<string> tags)
  4. Save NotificationOutcome.NotificationId
  5. Poll NotificationId Microsoft.Azure.NotificationHubs.NotificationHubClient.GetNotificationOutcomeDetailsAsync(string notificationId)

Code Snippet
Add the code snippet that causes the issue.

public async Task GetOutcomeDetails()
{
    var credentials =  new HubCredentials(
        connectionString: [RedactedFullSharedNotificationHubConnectionString],
        hubName: "[RedactedHubName]"
    var hub = NotificationHubClient.CreateClientFromConnectionString(credentials.ConnectionString, credentials.HubName);
    var result = await hub.GetNotificationOutcomeDetailsAsync(notificationId);
}

Expected behavior
Expected to get outcome details.

Screenshots
image

Setup (please complete the following information):

  • OS: Windows 10
  • IDE : Microsoft Visual Studio Enterprise 2022 (64-bit) - Version 17.7.4
  • 'Microsoft.Azure.NotificationHubs' NuGet package - Version 4.1.0

Additional context
Add any other context about the problem here.

In our production code we use a ASPNET Api endpoint to send notifications. Once sent we use the notification id from the outcome to enqueue a message for polling the notificationId outcome details in a QueueTrigger. Currently we have quite a few messages that end up in our poison queue due to this issue.

Context
TrackingId: 50f576d9-74bf-48f0-9ed9-9d19eb695aa7
TimeStamp: 10/11/2023 1:36:41 PM +00:00

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant