fix(kanban): widen notifier pre-filter to secondary-profile platforms - #56589
fix(kanban): widen notifier pre-filter to secondary-profile platforms#56589srojk34 wants to merge 1 commit into
Conversation
_collect()'s active_platforms pre-filter was derived solely from self.adapters (the default profile), so a subscription owned by a secondary profile on a platform the default profile never connected (e.g. beta owns discord, default has no discord adapter at all) was skipped before claim_unseen_events_for_sub ever ran. Unlike the disconnected-adapter path, an unclaimed event is never rewound, so this was a permanent, silent notification/wake loss — directly contradicting the point of routing notifications via the owning profile (c696430/b225b30d0). Same cross-profile-adapter-lookup bug class the delivery-side _authorization_adapter chokepoint already guards against, one gate earlier. The precise per-profile check still runs unchanged at delivery time, with its existing rewind-on-None safety net.
|
Thanks for the focused follow-up. The premise is confirmed on current main: The delivery invariant remains intact: Automated hermes-sweeper review. |
|
Merged via PR #72241 — your commit was cherry-picked onto current main with your authorship preserved. The widened pre-filter stops secondary-profile events being silently lost (claimed, never rewound). Thanks! |
Summary
_authorization_adapterchokepoint (gateway/authz_mixin.py) so a secondary profile's subscription is never silently delivered by the default profile's bot._kanban_notifier_watcher's_collect()pre-filters subscriptions byactive_platforms, a set built only fromself.adapters(the default/active profile). A subscription owned by a secondary profile on a platform the default profile never connected at all (e.g. profilebetahas a live Discord adapter, but the default profile has no Discord adapter) is dropped by this pre-filter beforeclaim_unseen_events_for_subis ever called.active_platformsto the union ofself.adaptersand every platform present acrossself._profile_adapters.values(). This is intentionally a coarse pre-filter — the precise per-profile chokepoint (_authorization_adapter, which still forbids default-profile fallback) runs unchanged at delivery time a few lines below, with its existing rewind-on-Nonesafety net for any sub that over-admits here but doesn't actually have a live adapter.Test plan
test_notifier_claims_platform_only_a_secondary_profile_ownstotests/gateway/test_kanban_notifier.py, reproducing the exact scenario (default profile has telegram only, secondary profilebetahas a live discord adapter, sub is owned bybetaon discord).kanban_watchers.pychange makes the new test fail (assert 0 == 1, adapter never receives the notification); passes with the fix.tests/gateway/test_kanban_notifier.pysuite (8 tests, includingtest_notifier_owning_profile_adapter_no_default_fallback) — all pass, no regressions.tests/gateway/ -k kanbansuite (22 passed, 2 skipped) — no regressions.