codeant-ai-for-open-source[bot] commented on code in PR #42484:
URL: https://github.com/apache/superset/pull/42484#discussion_r3699996358


##########
superset/utils/slack.py:
##########
@@ -139,6 +139,23 @@ def get_channels(
     return _get_channels(cache_key, team_id=team_id, **kwargs)
 
 
+_AUTH_ERROR_CODES = frozenset({"not_authed", "invalid_auth"})

Review Comment:
   **Suggestion:** The authentication classification is incomplete: Slack can 
return other invalid-token states such as `account_inactive`, `token_revoked`, 
or `token_expired`. Those failures still enter the `logger.error` branch in 
`_get_channels`, so revoked or deactivated workspace tokens continue generating 
Sentry errors despite the intended warning-only handling. Include all relevant 
Slack authentication error codes in this set, or classify authentication 
failures using the appropriate response metadata. [api mismatch]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ⚠️ Revoked Slack tokens still create Sentry errors.
   ```
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=d55caece2d674853be0452424f2a8221&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=d55caece2d674853be0452424f2a8221&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   
   *(Use Cmd/Ctrl + Click for best experience)*
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset/utils/slack.py
   **Line:** 142:142
   **Comment:**
        *Api Mismatch: The authentication classification is incomplete: Slack 
can return other invalid-token states such as `account_inactive`, 
`token_revoked`, or `token_expired`. Those failures still enter the 
`logger.error` branch in `_get_channels`, so revoked or deactivated workspace 
tokens continue generating Sentry errors despite the intended warning-only 
handling. Include all relevant Slack authentication error codes in this set, or 
classify authentication failures using the appropriate response metadata.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve 
this? If you propose a fix, implement it and please make it concise.
   Once fix is implemented, also check other comments on the same PR, and ask 
user if the user wants to fix the rest of the comments as well. if said yes, 
then fetch all the comments validate the correctness and implement a minimal fix
   ```
   </details>
   <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42484&comment_hash=61ca7fc84b2b77b682edf3724f2c717de21a6561da32b6965c40e14e2b9ec148&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42484&comment_hash=61ca7fc84b2b77b682edf3724f2c717de21a6561da32b6965c40e14e2b9ec148&reaction=dislike'>👎</a>



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to