refactor: check payload type before extracting assistant thread info#2603
refactor: check payload type before extracting assistant thread info#2603
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2603 +/- ##
=======================================
Coverage ? 93.37%
=======================================
Files ? 37
Lines ? 7581
Branches ? 667
=======================================
Hits ? 7079
Misses ? 497
Partials ? 5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
WilliamBergamin
left a comment
There was a problem hiding this comment.
Thank you for addressing this 🙏
Comparing this with the Bolt Python implementation AssistantUtilities and has_channel_id_and_thread_ts, I fear this may be creating a drift between the implementations 🤔 I'm not sure which one is correct, what do you think about mirroring the logic and adding what is needed to make it type compliant?
Let me know if I'm completely wrong on this, I'm not as up to speed on this as you are
|
@WilliamBergamin I appreciate the pushback on the initial change here 🤖 ✨ The approach you linked is great for handling changes to the underlying event types! Some searching for the cause of these errors lead to this update to the export interface GenericMessageEvent {
type: 'message';
...
assistant_thread?: Record<string, unknown>;
}Commit 62de663 uses the initial approach while now guarding against unexpected properties of |
|
@WilliamBergamin Praises once more for the callout in keeping implementations similar. I was not thinking so far ahead to added confusion of future changes 🧠💡 I'll merge this PR now to unblock tests, but I do also think a release is needed to fix unpinned installations with the recent release of the |
Summary
This PR checks the payload type before extracting
assistantthread info. Hopes to fix recent CI errors in #2601 and onmain👾Notes
typescriptversion as ci: output verbose details when installing packages for tests #2602 👁️🗨️bolt-js/test/unit/Assistant.spec.ts
Lines 252 to 298 in 3948ded
Requirements