-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
fix(channels): most channels missing namedAccountPromotionKeys — multi-account promotion strips shared defaults #62387
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:data-lossCan lose, corrupt, or silently drop user/session/config data.Can lose, corrupt, or silently drop user/session/config data.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.staleMarked as stale due to inactivityMarked as stale due to inactivity
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:data-lossCan lose, corrupt, or silently drop user/session/config data.Can lose, corrupt, or silently drop user/session/config data.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.staleMarked as stale due to inactivityMarked as stale due to inactivity
Type
Fields
Priority
None yet
Summary
When a channel config has named accounts but no
default, the doctor/channels addmigration moves top-level account-scoped keys intoaccounts.default. For channels that declarenamedAccountPromotionKeys, this is limited to credentials only — policy keys stay at the channel top level as shared defaults.Problem: Most channels do NOT declare
namedAccountPromotionKeys. The guard inresolveSingleAccountKeysToMove()short-circuits when the value isundefined:This means ALL movable keys (
groupPolicy,allowFrom,defaultTo, credentials, etc.) get swept intoaccounts.default, stripping shared defaults from existing named accounts.Channels with the guard
BUNDLED_NAMED_ACCOUNT_PROMOTION_FALLBACKSnamedAccountPromotionKeys)Channels WITHOUT the guard (affected)
Slack, Discord, WhatsApp, Signal, IRC, MS Teams, Google Chat, iMessage, Line, Nostr, Mattermost, Synology Chat, BlueBubbles, Tlon, Twitch, Zalo, and all other extensions.
Repro
Before migration — top-level acts as inherited base for all accounts:
Both
workandpersonalinheritgroupPolicyandallowFromvia the{ ...base, ...account }merge inmergeSlackAccountConfig().After
doctor --fix— shared defaults moved into phantomdefault:workandpersonalno longer inherit those values.Expected behavior
Each channel should declare
namedAccountPromotionKeyslisting only credential/auth keys that are per-account by nature (e.g.,botToken,appToken,signingSecret). Policy keys (groupPolicy,allowFrom,defaultTo) should remain at the channel top level as shared defaults.Alternatively, the fallback when
namedAccountPromotionKeysisundefinedcould default to credentials-only (conservative) rather than move-everything (destructive).Relevant code
src/channels/plugins/setup-helpers.ts—resolveSingleAccountKeysToMove()src/commands/doctor/shared/channel-legacy-config-migrate.ts(calls viaseedMissingDefaultAccountsFromSingleAccountBase)BUNDLED_NAMED_ACCOUNT_PROMOTION_FALLBACKS— only has TelegramBUNDLED_SINGLE_ACCOUNT_PROMOTION_FALLBACKS— only has TelegramRelated PRs