bito-code-review[bot] commented on PR #43623:
URL: https://github.com/apache/superset/pull/43623#issuecomment-5454415551

   <!-- Bito Reply -->
   The flagged issue is correct. In forced-refresh mode, the `token_session` is 
an isolated SQLAlchemy session that requires an explicit commit to persist 
deletions. Without this commit, the session closes and rolls back the deletion, 
causing the invalid token to persist and triggering repeated failed refresh 
attempts.
   
   To resolve this, you should commit the deletion within the `token_session` 
before it closes. Here is the suggested fix:
   
   ```python
   # Inside the forced-refresh block in superset/utils/oauth2.py
   # After the deletion logic:
   token_session.delete(token)
   token_session.commit()  # Ensure the deletion is persisted
   ```
   
   I have checked the available PR context, and there are no other comments to 
address. Would you like me to perform any further analysis?
   
   **superset/utils/oauth2.py**
   ```
   token_session.delete(token)
   token_session.commit()
   ```


-- 
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