Skip to content

Conversation

@mwbrooks
Copy link
Member

Summary

This PR updates the chat.startStream arguments to now require thread_ts. We are changing this because the Slack API has been updated to now require the thread_ts when starting a stream. This means all DMs and in-channel conversations with your bot will now have responses replied in-thread.

After merging, we'll need to update our sample apps to always provide thread_ts.

Requirements (place an x in each [ ])

@mwbrooks mwbrooks requested review from srtaalej and zimeg September 29, 2025 22:50
@mwbrooks mwbrooks self-assigned this Sep 29, 2025
@mwbrooks mwbrooks added bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented pkg:web-api applies to `@slack/web-api` labels Sep 29, 2025
Copy link
Member Author

@mwbrooks mwbrooks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notes for the kind reviewers! 🙇🏻

Partial<ThreadTS>,
Partial<MarkdownText>,
Unfurls {
export interface ChatStartStreamArguments extends TokenOverridable, Channel, Partial<MarkdownText>, ThreadTS, Unfurls {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: npm test linter requires this to be a single-line. I ordered it alphabetically.

@codecov
Copy link

codecov bot commented Sep 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (ai-apps@898becc). Learn more about missing BASE report.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             ai-apps    #2382   +/-   ##
==========================================
  Coverage           ?   92.78%           
==========================================
  Files              ?       39           
  Lines              ?    10711           
  Branches           ?      692           
==========================================
  Hits               ?     9938           
  Misses             ?      761           
  Partials           ?       12           
Flag Coverage Δ
cli-hooks 95.23% <ø> (?)
cli-test 94.80% <ø> (?)
oauth 77.39% <ø> (?)
socket-mode 61.87% <ø> (?)
web-api 98.00% <ø> (?)
webhook 96.66% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@zimeg zimeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mwbrooks Thanks so much for a fast update on this once more! ⭐

I marked this as a patch change since I believe aligning to the API methods can be considered a bugfix with invalid arguments erroring later anyways...

We should add this to a prerelease soon IMHO! 🚢 💨

// chat.startStream
// -- sad path
expectError(web.chat.startStream()); // lacking argument
expectError(web.chat.startStream({})); // empty argument
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
expectError(web.chat.startStream({})); // empty argument
expectError(web.chat.startStream({
channel: 'C1234', // missing thread_ts
}));

🧪 suggestion(non-blocking): Asserting that the previous behavior errors might be nice to have, but no blocker for this PR!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great suggestion @zimeg! Commit ef9bfc6 adds tests for missing thread_ts and missing channel. I couldn't bring in your suggestion because the linter wanted a different format 🤖 📏

@mwbrooks
Copy link
Member Author

Thanks for the quick review @zimeg and solid suggestion on covering the edge-case tests. 🙇🏻 I like that you've added the patch label. I was leaving it off because this is a PR into a branch, but personally I like seeing semver on all PRs 😄

@mwbrooks mwbrooks merged commit 520a2d6 into ai-apps Sep 29, 2025
57 checks passed
@mwbrooks mwbrooks deleted the mwbrooks-ai-apps-thread_ts-required branch September 29, 2025 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented pkg:web-api applies to `@slack/web-api` semver:patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants