mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-07-01 20:51:34 +08:00
fix(channels): stop missing-account resolver from copying root SecretRefs
When saving a new multi-account channel entry (e.g. accounts.work),resolve_platform_config_entry fell back to the channel root if theaccount id was not in accounts yet. preserve_messaging_credential_refsthen treated the default account SecretRef placeholders as unchangedand wrote them into the new account — both bots shared credentials. - Return None for unknown account ids (Rust + dev-api) - Skip config preload on Add Account dialog (accountId === '') - Lock account identifier field when editing an existing account - Add regression tests Co-authored-by: 晴天 <1186258278@users.noreply.github.com>
This commit is contained in:
@@ -6851,11 +6851,15 @@ function secretAwareAccountDisplayValue(value) {
|
||||
return formatSecretRefPlaceholder(value)
|
||||
}
|
||||
|
||||
function resolvePlatformConfigEntry(channelRoot, platform, accountId) {
|
||||
export function resolvePlatformConfigEntry(channelRoot, platform, accountId) {
|
||||
if (!channelRoot || typeof channelRoot !== 'object') return null
|
||||
const accountKey = typeof accountId === 'string' ? accountId.trim() : ''
|
||||
if (platformStorageKey(platform) === 'tlon' && accountKey === QQBOT_DEFAULT_ACCOUNT_ID) return channelRoot
|
||||
if (accountKey) return channelRoot.accounts?.[accountKey] || channelRoot
|
||||
if (accountKey) {
|
||||
const entry = channelRoot.accounts?.[accountKey]
|
||||
if (entry && typeof entry === 'object') return entry
|
||||
return null
|
||||
}
|
||||
if (platformStorageKey(platform) === 'qqbot' && !channelHasQqbotCredentials(channelRoot)) {
|
||||
return channelRoot.accounts?.[QQBOT_DEFAULT_ACCOUNT_ID] || channelRoot
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user