CNA-BUG-158: RawPushNotificationMessage::SendAsync and ToastPushNotificationMessage::SendAsync return true for a push the receiver rejected
Evidence basis: source-verified at the pinned commit; tests exist (not executed for this page). Claims on this page were checked by reading the CNA source at commit 009d40f5; unless a sentence says otherwise, nothing here was built or executed. Nothing on this page was executed unless the Evidence section says so.
Both SendAsync methods are documented to return true when the receiver accepted the notification, but they return true whenever the whole request was written; the reply is read and discarded, so an HTTP 400 still yields true.
- Identifier
CNA-BUG-158- Category
- Bug
- Subsystem
- Networking & gamer services
- Status
- Open
- Verified against
- CNA
009d40f5(009d40f5dd085c4e674d3479675fac84b12b3e0a) - Severity
- Low (a triage suggestion, not a project priority)
- Evidence basis
- Source-verified: read at TARGET, not executed
- Tests touching this area
- Yes: see Current tests
- Affected contract
- Microsoft::Phone::Notification::RawPushNotificationMessage::SendAsync(const System::Uri&) and ToastPushNotificationMessage::SendAsync(const System::Uri&)
Expected behaviour
Both methods document @return True when the receiver accepted it. (The raw message's description also says it “returns as soon as the request is on its way”, so the header contradicts itself; the @return is the specific promise a caller reads.)
Actual behaviour at TARGET
Both methods call the internal Post: it splits the URI, resolves IPv4 with getaddrinfo, connects, writes the request with one send, sets sent to “every byte was written”, then does one recv of up to 512 bytes into a discarded buffer and returns sent. The status line is never parsed: a 400 from HttpNotificationChannel (its reply to an unreadable request), a 500 from another server, or a receiver that closes without replying all yield true. false means only a URI without //, a lookup, socket or connect failure, or a short write.
Source locations
modules/phone/src/PushNotificationSender.cpp— Post (return value), RawPushNotificationMessage::SendAsync, ToastPushNotificationMessage::SendAsyncmodules/phone/include/Microsoft/Phone/Notification/PushNotificationSender.hpp— SendAsync documentation of both classes
Evidence
Checked by reading PushNotificationSender.cpp and its header at 009d40f5; both are unchanged since the earlier recorded pin. Not executed.
Focused reproduction
No focused reproduction is known. Nothing has been invented here; the evidence above is what exists.
Current tests
PushNotificationSenderTest.WhatTheSenderPostsIsWhatTheChannelReceives and AToastCarriesItsTitleToTheReceiver check true against a channel that accepts; SendingToAnAddressNobodyIsListeningOnFails checks false for a refused connection. None uses a receiver that answers with an error status.
Regression test
A loopback test server that replies HTTP/1.1 400 Bad Request: SendAsync must return false, or the header must be corrected to “true when the request was written”.
Blast radius
Callers that use the return value to decide whether to retry or to report a failed push. CNA-to-CNA pushes that the channel accepts are unaffected.
Workaround
Treat true as “written” and confirm delivery at the application level where it matters.
Related pages
The same subject is explained at several altitudes. These are the neighbouring pages at each one.
- Known issues
- Bug index