You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I did some digging and it looks like Mozilla Autopush Server is implementing an older (expired) version of WebPush specification (at least this is what they are referring to in their docs: https://mozilla-services.github.io/autopush-rs/http.html#send-notification). That older version wasn't too specific about return codes:
A simple 200 response is sufficient to indicate that the push message was accepted. This does not indicate that the message was delivered to the user agent.
The current version is a little bit more specific:
A 201 (Created) response indicates that the push message was accepted.
That said, it doesn't seem to forbid other statuses, which means that what Mozilla Autopush Server is doing (returning 202
when message will be delivered at a later time and 200 when message has been delivered to node client is connected to) is valid.
I will adjust the implementation to consider all three (200, 201, and 202) as success.
Description
When sending a message to an endpoint registered by Firefox on Android an exception is incorrectly thrown.
Reproduction Steps
Using Firefox on Android (tested with 131.0.3), register for push notifications.
Send a push notification to the registered endpoint.
Expected behavior
The mesage is received and no exception occurs.
Actual behavior
The mesage is received but a PushServiceClientException is thrown with no Body and a HttpStatusCode of OK (200)
Possibly cause
It seems the below line, should check for either HttpStatusCode.Created or HttpStatusCode.OK before throwing an exception.
Lib.Net.Http.WebPush/src/Lib.Net.Http.WebPush/PushServiceClient.cs
Line 392 in fef97af
The text was updated successfully, but these errors were encountered: