Repository navigation
fix(pm-console): accept Chrome's other push host, and say whether notifications reach this device - #12934
Merged
Conversation
…ifications reach this device Found by sending real notifications, not by reading the code. The console's own sender was run against the real push services: - Mozilla's: subscribed the way Firefox does, sent with src/push.ts (as the host runs it, and again with the request made inside the Worker runtime), received over the network and opened with http_ece, a decryption that shares nothing with this code. The message arrived whole both times. - Google's: a real Chrome 153 subscribed with public/sw.js. The sender refused the subscription: that Chrome names jmt17.google.com, the host Chromium gives any Chrome off the stable channel (components/push_messaging/push_messaging_constants.cc), and only fcm.googleapis.com was accepted. With the host accepted, Google took the message (201). What was wrong, and is fixed: - A Chrome off the stable channel could not turn notifications on. Its host is now accepted, by exact name. - When the sender refused or lost a device, the Notifications screen still said "On for this device", because it asked only the browser. It now asks the sender too: such a device is "Not finished on this device", with one button to finish, and the button is no longer left dead after a refusal. - Nothing said whether a notification had ever gone out. The sender now keeps what came of the last one (how many devices the push services took it for, which service refused and with what status; never a device's address or key) and the screen says it in a sentence. public/sw.js had no test. test/sw.test.ts runs the file itself: what it shows for a message, for one it cannot read, and where a tap goes. The same file was also handed messages in a real Chrome the way Chrome hands them over on arrival, and showed the same notifications. Not checked: a notification arriving on a phone. Chrome's own connection to Google's push service cannot be held from the machine this was done on, so delivery past Google's acceptance was seen only on Mozilla's service. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YLT5K1QVuzZjfWGFhXSSNF
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 11 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found by sending real notifications through the real push services with the console's own sender, not by reading the code.
What was done
src/push.tsas the host runs ithttp_ece(a decryption that shares nothing with this code)wrangler dev)public/sw.jssrc/push.tsWhat was wrong, and is fixed
jmt17.google.com(Chromium'spush_messaging_constants.cc), and onlyfcm.googleapis.comwas accepted. That host is now accepted, by exact name.public/sw.jshad no test;test/sw.test.tsruns the file itself. The same file was handed messages in a real Chrome the way Chrome hands them over on arrival, and showed the same notifications.Checked
bun test: 193 pass. Eleven planted faults (the host left out, matched as a suffix, a refusal not recorded, "on" whatever the sender holds, the tap forgetting its screen, and six more), each caught.Not checked
A notification arriving on a phone. Chrome's own connection to Google's push service cannot be held from the machine this was done on, so delivery past Google's acceptance was seen only on Mozilla's service.
Generated by Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.