Commit 0851cd4
Kai Liu
fix(slack): resolve workspace token first for synthetic-thread sends
Addresses Codex P2 review on PR #212. When threadIsSynthetic is true,
sendMessage degenerates to a top-level channel post (no thread_ts), but
the token was still being resolved with getSlackBotToken(channelId,
threadId) first. In multi-workspace installs where a scheduled task/cron
fires before that channel has been seen by the message router, the
registry has no entry for the fake thread_ts and getSlackBotToken can
fall back to the first registered token instead of the token for
rawChannelId — leading to a follow-on channel_not_found / not_in_channel
even though dropping thread_ts was supposed to make the message
deliverable.
Mirror the token-resolution chain that sendChannelMessage already uses
for top-level posts:
processor token -> workspace-by-channel token -> getSlackBotToken
for the synthetic path. The real-thread path is unchanged so registry
bindings for in-flight thread replies still win.
Tests: full suite still green (408 pass, 1 skip, 0 fail).1 parent f09ecb3 commit 0851cd4
1 file changed
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
312 | | - | |
313 | 312 | | |
314 | 313 | | |
315 | 314 | | |
| |||
320 | 319 | | |
321 | 320 | | |
322 | 321 | | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
323 | 336 | | |
324 | 337 | | |
325 | 338 | | |
| |||
0 commit comments