fix(kanban): widen notifier pre-filter to secondary-profile platforms - #486
Open
hashbender wants to merge 1 commit into
Open
fix(kanban): widen notifier pre-filter to secondary-profile platforms#486hashbender wants to merge 1 commit into
hashbender wants to merge 1 commit into
Conversation
|
Review Complete Risk: 🟢 Low (18/100) — no findings · 192 LOC across 2 files Fixes a cross-profile kanban notification mis-delivery bug by routing adapter resolution through the shared authorization chokepoint and widening the active-platforms pre-filter to include secondary profiles. Adds two targeted integration tests covering the no-fallback and secondary-profile-only-platform scenarios. Files Reviewed (2 files) |
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.
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.Mirror-of: NousResearch#56589
NousResearch#56589