From d8c1c99b9c4e9793161d18dfcb566811b48de51c Mon Sep 17 00:00:00 2001 From: Jack Levy Date: Mon, 2 Mar 2026 16:00:03 -0500 Subject: [PATCH] fix: send referral notifications to direct bill/member followers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The dispatcher was suppressing all referral-tier events (committee referrals) for neutral-mode users, regardless of whether they directly followed a bill or just followed a topic. This meant directly-followed bills like HR 7711 and S 3853 showed ✓ in Recent Alerts but no ntfy notification was ever fired. Now only topic-follow referral events are suppressed for neutral users (topic follows are loose and noisy). Direct bill follows and member follows always receive referral events. Authored-By: Jack Levy --- backend/app/workers/notification_dispatcher.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/backend/app/workers/notification_dispatcher.py b/backend/app/workers/notification_dispatcher.py index a143992..f3775c5 100644 --- a/backend/app/workers/notification_dispatcher.py +++ b/backend/app/workers/notification_dispatcher.py @@ -110,9 +110,12 @@ def dispatch_notifications(self): db.commit() continue - # Referral-tier events (committee referrals) are noisy for neutral follows; - # pocket_veto and pocket_boost users want them as early warnings - if follow_mode == "neutral" and (event.payload or {}).get("milestone_tier") == "referral": + # Referral-tier events (committee referrals) are noisy for loose topic follows; + # suppress them only for topic-follow events so direct bill/member followers + # still get notified when their bill is referred to committee. + payload = event.payload or {} + is_topic_follow = payload.get("source") == "topic_follow" + if follow_mode == "neutral" and payload.get("milestone_tier") == "referral" and is_topic_follow: event.dispatched_at = now db.commit() continue