Slack: Retry to auth if some scopes are missing#17640
Conversation
|
Thank you for your contribution! 🎉 🔔 @momme-rtf @Elliot67 @jfkisafk @thomaslombart @RobErskine you might want to have a look. You can use this guide to learn how to check out the Pull Request locally in order to test it. Due to our current reduced availability, the initial review may take up to 10-15 business days |
There was a problem hiding this comment.
PR Summary
This PR adds a retry mechanism to handle missing Slack scopes by clearing tokens and re-authenticating when needed in the status setting functionality.
- The global
retriedflag in/extensions/slack/src/tools/set-status.tscould cause race conditions if multiple status updates happen simultaneously - consider making it request-scoped - The error handling in
/extensions/slack/src/tools/set-status.tscould be simplified usingshowFailureToastfrom@raycast/utilsinstead of throwing errors - The
launchCommandin/extensions/slack/src/tools/set-status.tsshould be wrapped in a try-catch block for better error handling
💡 (4/5) You can add custom instructions or style guidelines for the bot here!
1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
| duration?: number; | ||
| }; | ||
|
|
||
| let retried = false; |
There was a problem hiding this comment.
logic: Global retried flag could cause issues if multiple status updates are attempted in the same session. Consider moving this into the function scope.
| let retried = false; | |
| async function setStatus(input: Input) { | |
| let retried = false; |
thomaspaulmann
left a comment
There was a problem hiding this comment.
Looks good and hopefully resolves the issue. I wonder if we should move that logic down into the utils. So other extensions would benefit of it as well.
|
|
|
Published to the Raycast Store: |
|
🎉 🎉 🎉 We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag. |
Description
Screencast
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare located outside the metadata folder if they were not generated with our metadata tool