supabase / auth-py

Python client implementation for Supabase Auth
MIT License
76 stars 40 forks source link

Remove unnecessary async method definitions from AsyncStorage #536

Closed mathatan closed 4 months ago

mathatan commented 4 months ago

Removed the non-required async definitions and await operations with async storage, resulting in TypeError: object NoneType can't be used in 'await' expression errors if the session is not defined before get_session is called with tokens. (or in any case when data is set to None before trying to retrieve it)

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

When creating supabase through create_async_client it's not possible to set/get the session with tokens due to the mentioned issue.

What is the new behavior?

After async def and awaits are removed everything works. (tested originally with local changes in the files, additional context reveals actual testing against committed changes was not possible)

Additional context

I couldn't run tests against the pull request because pytest doesn't work and because it's impossible to replace the library's installation for supabase(py) because it still refers to the old gotrue project. Also, I'm not sure if there's a requirement for the async behavior so this PR might be against the needs, but as I can't use the library at all before this is fixed I'm forced to make this pull request asap.

Problems were encountered in Python 3.12.3 while running langserve through langchain. As I'm not an experienced Python developer there might be something I'm missing here. Feel free to comment or modify the pull request where needed.

Thanks,

sourcery-ai[bot] commented 4 months ago

🧙 Sourcery has finished reviewing your pull request!


Tips - Trigger a new Sourcery review by commenting `@sourcery-ai review` on the pull request. - You can change your review settings at any time by accessing your [dashboard](https://app.sourcery.ai): - Enable or disable the Sourcery-generated pull request summary or reviewer's guide; - Change the review language; - You can always [contact us](mailto:support@sourcery.ai) if you have any questions or feedback.
silentworks commented 4 months ago

This is not how this works. You need to provide a test case and show the PR fixing that. I'm closing this out until this is provided.

mathatan commented 4 months ago

Well thanks for nothing I suppose. I will just maintain my own branch from now on until this is fixed and not help with anything with this community.