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

Sporadic failure to dispatch push notifications is invisible to consuming app #55

Open
JimKerslake opened this issue Apr 2, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@JimKerslake
Copy link
Collaborator

Very occasionally:

Failed requesting push message delivery to "https://wns2-ln2p.notify.windows.com/w/?token=BQYAAAAX******".

Exception
System.InvalidOperationException: The request message was already sent. Cannot send the same request message multiple times. at System.Net.Http.HttpClient.CheckRequestMessage(HttpRequestMessage request) at System.Net.Http.HttpClient.CheckRequestBeforeSend(HttpRequestMessage request) at Lib.Net.Http.WebPush.PushServiceClient.RequestPushMessageDeliveryAsync(PushSubscription subscription, PushMessage message, VapidAuthentication authentication, VapidAuthenticationScheme authenticationScheme, CancellationToken cancellationToken) at cloudscribe.PwaKit.Services.PushServicePushNotificationService.SendNotificationAsync(PushSubscription subscription, PushMessage message, CancellationToken cancellationToken)

But because this is happening from a background task / queue in this assembly, there is no way that this can report the failure back up to a consuming app so that it can re-schedule and try again. Failure is therefore invisible in consuming app (apart from the log line above).

Try updating:
Lib.Net.Http.WebPush
Lib.AspNetCore.WebPush

But also perhaps need some kind of injectable custom error handler somewhere in around
DequeueMessagesAsync >> SendNotificationAsync >> HandlePushMessageDeliveryExceptionAsync

Is this perhaps even something at the endpoint side of things?:
https://wns2-ln2p.notify.windows.com/w/
Test - does it happen with google endpoints too?
It's very sporadic - (not provoked it today at all yet.)

@JimKerslake JimKerslake added the bug Something isn't working label Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant