Skip to content

fix(perm): 容错同机 Bot 的非法 botName - #2390

Merged
deepcoldy merged 2 commits into
deepcoldy:masterfrom
kunshanyep-beep:fix/same-owner-botname-guard
Oct 27, 2026
Merged

deepcoldy merged 2 commits into
deepcoldy:masterfrom
kunshanyep-beep:fix/same-owner-botname-guard

Conversation

@kunshanyep-beep

Copy link
Copy Markdown
Contributor

Summary

  • fail closed when the target sibling's botName is not a string
  • ignore malformed unrelated names during uniqueness checks and cover both cases with regressions
  • document the trustSameOwnerBots fallback behavior in Chinese and English

Tests

  • bun run test -- test/event-dispatcher.test.ts (583 passed)
  • bun run test -- test/test-hygiene.test.ts (26 passed)
  • bun run build
  • git diff --check

Closes #2360

# Conflicts:
#	test/event-dispatcher.test.ts
@deepcoldy
deepcoldy merged commit 6d8f186 into deepcoldy:master Oct 27, 2026
9 checks passed
@deepcoldy

Copy link
Copy Markdown
Owner

已合并,感谢修复!

合入的是 #2360 点名的两处类型守卫 + 文档说明,最终落地补丁为 4 文件 +30/-5,与 PR 内容一致(分支同步主干时只在测试 import 行做了一次并集合并)。

三个不阻断的收尾项已整理到 follow-up issue #2410,欢迎继续认领:

  1. updateBotOpenIdCrossRef 的 knownBotNames 循环补同款 typeof 守卫(畸形条目排在目标之前时回填会被外层 catch 静默吞掉,fail-closed 但自愈不生效);
  2. bots-info.json 数组元素本身为 null/非对象时的元素级过滤;
  3. permissions 文档「需要重新 /grant」补「若它还没被认出」的限定。

欢迎后续继续贡献。

@github-actions

Copy link
Copy Markdown

🚀 Released in v3.54.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(perm): sameOwnerBot 回填 cross-ref 的 botName 加类型守卫;补「关闭信任后已有群需重新授权」文档

2 participants