When I use the default Options.TTL of 0, the Windows Push Notification Service (WNS) rejects the request with status 400 and these headers:
X-Wns-Error-Description: Ttl value conflicts with X-WNS-Cache-Policy.
X-Wns-Notificationstatus: dropped
X-Wns-Status: dropped
This seems to be because webpush-go includes an explicit TTL: 0 header, which Microsoft interprets as "do not cache", but according to https://learn.microsoft.com/en-us/previous-versions/windows/apps/hh465435(v=win.10) the default X-WNS-Cache-Policy is to enable caching, hence the conflict.
I was able to work around this by providing a non-zero TTL, but maybe this can be solved on library level by only setting the TTL header if the value isn't 0?
When I use the default
Options.TTLof 0, the Windows Push Notification Service (WNS) rejects the request with status 400 and these headers:This seems to be because webpush-go includes an explicit
TTL: 0header, which Microsoft interprets as "do not cache", but according to https://learn.microsoft.com/en-us/previous-versions/windows/apps/hh465435(v=win.10) the defaultX-WNS-Cache-Policyis to enable caching, hence the conflict.I was able to work around this by providing a non-zero TTL, but maybe this can be solved on library level by only setting the TTL header if the value isn't 0?