Skip to content

Client.cs patch - Fixes Connect() not returning callback result when the socket isn't null #26

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Conversation

BlueWaterCrystal
Copy link
Contributor

@BlueWaterCrystal BlueWaterCrystal commented Mar 23, 2023

Fixes Connect() not returning callback result when the socket isn't null.

What kind of change does this PR introduce?

Added callback?.Invoke(this); to Connect() in Client.cs

What is the current behavior?

ConnectAync() hangs when Connect() doesn't return a callback result.

Which is also used by supabase-csharp - client.InitializeAsync();

supabase-community/supabase-csharp#60

What is the new behavior?

Connect() invokes the callback and then returns.
ConnectAync() Doesn't get stuck when the socket isn't null.

Additional context

This issue was introduced in 5.0.2, I believe before the result was created using TrySetResult() istead of SetResult Callback.

Fixes Connect() not returning callback result when the socket isn't null.
@acupofjose
Copy link
Contributor

Great catch - thanks so much for taking the time to debug this for us!

@acupofjose acupofjose merged commit 1f0ff1f into supabase-community:master Mar 24, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants