fix: resolve ChatStreamer import path and TypeScript narrowing issue
- Import ChatStreamer from @slack/web-api/dist/chat-stream.js (not re-exported from index) - Fix TypeScript control flow narrowing for streamSession used in closure
This commit is contained in:
@@ -284,9 +284,10 @@ export async function dispatchPreparedSlackMessage(prepared: PreparedSlackMessag
|
||||
// -----------------------------------------------------------------------
|
||||
// Finalize the stream if one was started
|
||||
// -----------------------------------------------------------------------
|
||||
if (streamSession && !streamSession.stopped) {
|
||||
const finalStream = streamSession as SlackStreamSession | null;
|
||||
if (finalStream && !finalStream.stopped) {
|
||||
try {
|
||||
await stopSlackStream({ session: streamSession });
|
||||
await stopSlackStream({ session: finalStream });
|
||||
} catch (err) {
|
||||
runtime.error?.(danger(`slack-stream: failed to stop stream: ${String(err)}`));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user