Commit 3fe47b9 1 parent dcb9960 commit 3fe47b9 Copy full SHA for 3fe47b9
File tree 1 file changed +8
-1
lines changed
extensions/slack/src/tools
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 1
- import { getSlackWebClient } from "../shared/client/WebClient" ;
1
+ import { getSlackWebClient , slack } from "../shared/client/WebClient" ;
2
2
import { withSlackClient } from "../shared/withSlackClient" ;
3
3
4
4
type Input = {
@@ -20,6 +20,8 @@ type Input = {
20
20
duration ?: number ;
21
21
} ;
22
22
23
+ let retried = false ;
24
+
23
25
async function setStatus ( input : Input ) {
24
26
const slackWebClient = getSlackWebClient ( ) ;
25
27
@@ -32,6 +34,11 @@ async function setStatus(input: Input) {
32
34
} ) ;
33
35
34
36
if ( res . error ) {
37
+ if ( res . error ?. includes ( "missing_scope" ) && ! retried ) {
38
+ retried = true ;
39
+ await slack . client . removeTokens ( ) ;
40
+ return withSlackClient ( setStatus ) ( input ) ;
41
+ }
35
42
throw new Error ( res . error ) ;
36
43
}
37
44
You can’t perform that action at this time.
0 commit comments