-
Notifications
You must be signed in to change notification settings - Fork 3k
feat(web-shell): redesign Channel policy and workspace management #8848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f6f74a2
c197181
aed48dc
3807cb9
111e17e
2333a05
f7adc65
f8ac419
907b46a
26849ba
b6f26d0
49f7a25
844d833
410543b
7c5c125
a811c93
013b31e
3a7b0f0
ec7f42f
6c532fe
fd6241b
1bd4a48
ad365b8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -430,6 +430,30 @@ describe('WeComChannel', () => { | |
| rmSync(join(tmpdir(), 'channel-files'), { recursive: true, force: true }); | ||
| }); | ||
|
|
||
| it('shares attachment routing across senders in chat_thread scope', () => { | ||
| const channel = new WeComChannel( | ||
| 'bot', | ||
| makeConfig({ sessionScope: 'chat_thread' }), | ||
| makeBridge(), | ||
| ); | ||
| const routeKey = ( | ||
| channel as unknown as { | ||
| attachmentRouteKey( | ||
| senderId: string, | ||
| chatId: string, | ||
| threadId?: string, | ||
| ): string; | ||
| } | ||
| ).attachmentRouteKey.bind(channel); | ||
|
|
||
| expect(routeKey('alice', 'chat-1', 'topic-1')).toBe( | ||
| routeKey('bob', 'chat-1', 'topic-1'), | ||
| ); | ||
| expect(routeKey('alice', 'chat-1', 'topic-1')).not.toBe( | ||
| routeKey('alice', 'chat-2', 'topic-1'), | ||
| ); | ||
|
Comment on lines
+449
to
+454
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion] This test never varies or omits 中文说明该测试从不改变或省略 — qwen3.8-max via Qwen Code /review (v0.21.8) |
||
| }); | ||
|
|
||
| it('requires botId and secret', () => { | ||
| expect( | ||
| () => new WeComChannel('bot', makeConfig({ botId: '' }), makeBridge()), | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -770,6 +770,10 @@ export class WeComChannel extends ChannelBase { | |
| switch (this.config.sessionScope) { | ||
| case 'thread': | ||
| return `${this.name}:${threadId || chatId}`; | ||
| case 'chat_thread': | ||
| return threadId | ||
| ? `${this.name}:${chatId}:${threadId}` | ||
| : `${this.name}:${chatId}`; | ||
|
Comment on lines
+773
to
+776
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion] This added switch is now a second full copy of 中文说明新增的这段 switch 现在是 — qwen3.8-max via Qwen Code /review (v0.21.8)
Comment on lines
771
to
+776
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Critical] Routing key format change for 中文说明迁移后 — deepseek-v4-flash via Qwen Code /review (v0.21.8)
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 已修复 + 验证证据:b6f26d0dee;config-utils.test.ts 50/50、channel-editor-state.test.ts 31/31 通过,legacy thread 在加载和编辑保存两条路径保持原路由与授权语义。 |
||
| case 'single': | ||
| return `${this.name}:__single__`; | ||
| case 'user': | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Suggestion] This row announces
chat_thread, but the "Routing keys by scope" table further down this same README (~lines 244-250) still lists onlyuser/thread/single— omittingchat_threadand leaving deprecatedthreadunmarked. That table is the only documentation of the key shapes (repo-wide grep), and this PR exists precisely because a routing-key shape was hand-duplicated out of sync. Add achat_threadrow (channel:chatId:threadId, orchannel:chatIdwithout threadId — one session per chat thread, shared across senders) and mark thethreadrow deprecated.中文说明
这一行宣告了
chat_thread,但同一 README 下方的 "Routing keys by scope" 表(约 244-250 行)仍只列出user/thread/single——遗漏了chat_thread,也未标注thread已废弃。该表是键形状的唯一文档(全仓库 grep 确认),而本 PR 正是因为路由键形状被手工复制后失同步才产生的。请补一行chat_thread(channel:chatId:threadId,无 threadId 时为channel:chatId——每个 chat thread 一个会话、跨发送者共享),并把thread行标注为废弃。— qwen3.8-max via Qwen Code /review (v0.21.8)