feat(newsletter): mute/unmute channel notifications - #757
Conversation
Adds Newsletter::set_follower_mute and set_admin_mute, mirroring WA Web's
WAWebNewsletterUpdateUserSettingJob. Both go through the vendored
update_newsletter_user_setting MEX mutation with the wire shape
{ input: { newsletter_id, type, value } }, where type is
MUTE_FOLLOWER_ACTIVITY / MUTE_ADMIN_ACTIVITY and value is ON/OFF. The
mute-expiration WA Web tracks is local DB state, not on the wire, so the
public API is a simple bool.
The generated op's input type is an opaque string, so the structured input
object is passed via mex_request!'s raw-variables form. Verified against
docs/captured-js/WAWeb/Newsletter/UpdateUserSettingJob.js and
Mex/UpdateNewsletterUserSetting*.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis PR extends the Newsletter feature with mute/unmute operations for follower-activity and admin-activity notifications. Two public methods execute the ChangesNewsletter notification mute
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Benchmark Results67 unchanged benchmark(s)
|
Closes the features-04 gap.
There was no way to mute a newsletter/channel — WA Web supports silencing follower-activity (and, for owners/admins, admin-activity) notifications, but the library exposed nothing.
Adds
Newsletter::set_follower_mute(jid, muted)andNewsletter::set_admin_mute(jid, muted), both going through the vendoredupdate_newsletter_user_settingMEX mutation. The wire shape matches WA Web exactly:{ input: { newsletter_id, type, value } }wheretypeisMUTE_FOLLOWER_ACTIVITY/MUTE_ADMIN_ACTIVITYandvalueisON/OFF. WA Web's mute-expiration is local DB state (never on the wire), so the public API is a simplebool.The generated op's
inputis an opaque string (relay-compiled, the input object type isn't expanded), so the structured object is passed viamex_request!'s raw-variables form rather than the typedVariables { input: String }.Test:
mute_variables_match_wa_web_shapelocks the variables shape (newsletter_id / type / ON-OFF) so a wire-format regression is caught without a live server.Verified against
docs/captured-js/WAWeb/Newsletter/UpdateUserSettingJob.js(the{ newsletter_id, type, value }call) andMex/UpdateNewsletterUserSetting.js+UpdateNewsletterUserSettingJobMutation.graphql.js(doc_id 31938993655691868, matches the vendored op).