zaru / webpush

webpush, Encryption Utilities for Web Push protocol
MIT License
394 stars 73 forks source link

Treat 406 from Microsoft as 429 #103

Open ngoral opened 2 years ago

ngoral commented 2 years ago

According to documentation Microsoft servers don't send 429, but sometimes they start sending 406, which basically means "try again later" as I see it. I'd rather receive TooManyRequests error instead of NotAcceptable, 'cause it requires the same processing. As far as I'm concerned, other services do not send 406, so it should be OK.

aglushkov commented 2 years ago

@zaru can you please merge and release new version? This 406 error is really annoying for many people

collimarco commented 1 year ago

This proposal is semantically wrong: you cannot catch a 406, which has a very specific meaning, and raise TooManyRequests. It may produce exceptions that are extremely confusing and hard to debug in the future, with other push services, or with future changes.

However I understand that the bug is caused by Microsoft. Is there at least a specific resp.message that we can detect?