microsoft / microsoft/WindowsAppSDK

Windows Push Notification service (WNS) returns the wrong status code for rate limiting

Open
#3,501 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area-Notifications bug
Dominant language
C++
Stars
4.7k
Forks
471
Avg merge
3d 13h
Merged PRs (30d)
28

Description

### Describe the bug

From [your docs](https://learn.microsoft.com/en-us/windows/apps/design/shell/tiles-and-notifications/push-request-response-headers#response-codes):

> 406 Not Acceptable
> The cloud service exceeded its throttle limit.
> Please send your request after the Retry-After header value in the response

This is plain wrong and against the standard. You MUST return `429 Too Many Requests` for rate limiting.

Returning 406 breaks various web push libraries and services, that don't handle the response properly.

For example: https://github.com/zaru/webpush/pull/103

### Steps to reproduce the bug

Send many web push messages in parallel to Edge / WNS.

### Expected behavior

Return HTTP status 429 for rate limiting.

### Screenshots

_No response_

### NuGet package version

None

### Windows version

_No response_

### Additional context

_No response_

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the WNS response-code documentation and the linked webpush pull request, then reproduce rate limiting by sending many web push messages in parallel to Edge/WNS. Done means the service returns HTTP 429 Too Many Requests, with Retry-After, instead of 406 for throttled requests.

Written by the indexing model from the issue text.

Assessment

Domain
api, networking
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.