-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
retried
flag in/extensions/slack/src/tools/set-status.ts
could cause race conditions if multiple status updates happen simultaneously - consider making it request-scoped - The error handling in
/extensions/slack/src/tools/set-status.ts
could be simplified usingshowFailureToast
from@raycast/utils
instead of throwing errors - The
launchCommand
in/extensions/slack/src/tools/set-status.ts
should 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
@@ -20,6 +20,8 @@ type Input = { | |||
duration?: number; | |||
}; | |||
|
|||
let retried = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 build
and tested this distribution build in Raycastassets
folder are used by the extension itselfREADME
are located outside the metadata folder if they were not generated with our metadata tool