Skip to content

fix: update Supabase token retrieval to remove unnecessary await #2166

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

suysoftware
Copy link
Contributor

@suysoftware suysoftware commented May 1, 2025

The get_user method in the SDK is defined as a regular def function, not an async def. For this reason, trying to call it with await results in a TypeError: object is not awaitable error.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Changes requested ❌

Reviewed everything up to 1b44f15 in 1 minute and 12 seconds. Click for details.
  • Reviewed 13 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. py/core/providers/auth/supabase.py:77
  • Draft comment:
    Inconsistent handling of get_user: decode_token now calls it synchronously, while user() still awaits it. Verify if get_user is sync; if so, update both places for consistency.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_yysxCF2JQorTcrH2

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@@ -74,7 +74,7 @@ async def decode_token(self, token: str) -> TokenData:
token = token[7:]

# Get Supabase token information
auth_response = await self.supabase.auth.get_user(token)
auth_response = self.supabase.auth.get_user(token)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure consistency in using await for get_user. Other methods (e.g., user()) await this call, so confirm if get_user is sync. If it’s async, removing await is a bug.

Suggested change
auth_response = self.supabase.auth.get_user(token)
auth_response = await self.supabase.auth.get_user(token)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@suysoftware can you confirm if this is a valid comment? Just want to verify that everything is working for you and then I will merge. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants