Repository navigation
Comments: Show the subscribe switch on for readers who already subscribe - #55613
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Code Coverage SummaryThis PR did not change code coverage! That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷 |
Fixes CM-1061
Proposed changes
After a reader signs in with WordPress.com from the comment dialog, the subscribe switch shows off even when that account already subscribes to the site by email. The switches come from the server-rendered form, which only knows about the logged-out visitor.
subscribed_blogflag from the sign-in popup's message.true, turn the site subscription switch on before the dialog shows the subscribe step. A missing or non-boolean value leaves the switches as they are today.This needs a wpcom change that adds
subscribed_blogto the comment sign-in popup's message. That PR isn't filed yet, and it should merge first. Until it ships, this change does nothing.Related product discussion/links
Does this pull request change what data or activity we track or use?
No.
Testing instructions
Needs the wpcom change on the sandbox.
Proof
The live steps need the wpcom change, which hasn't run on the sandbox yet, so the full flow isn't verified. The owner waived the before reproduction, so there are no screenshots.
What this PR changes was checked in isolation. A Node script ran the real
signIn()against a stubbed popup and posted the popup message:The same script fails on trunk, which returns
subscribedBlog: undefinedfor thetruecase. Prettier passes on the changed files. ESLint and the typecheck didn't run locally, so CI covers them. The dialog line that turns the switch on wasn't exercised, because it needs a build.Review
Council, risk medium, approval 92%, 1 round.
subscribe_blogon. The line already says it.subscribe_blog. The PHP side uses the same literal, so a JS-only constant wouldn't tie them together.Created with Claude Opus 5.5 in Claude Code.