Skip to content

Conversation

@grdsdev
Copy link
Contributor

@grdsdev grdsdev commented May 15, 2024

What kind of change does this PR introduce?

I wasn't able to reproduce it, but I have an assumption that these changes may fix the following crashes.

Fix #239
Fix #385

What is the current behavior?

Inner clients from SupabaseClient were defined as lazy var, but lazy var isn't thread-safe in Swift, this was probably causing some crashes when accessed from different threads.

We also relied on it to mark the SupabaseClient class as @unchecked Sendable.

What is the new behavior?

Moved inner clients to a LockIsolated and made SupabaseClient conform to Sendable.

@grdsdev grdsdev requested a review from dshukertjr May 15, 2024 08:44
@grdsdev grdsdev merged commit 811e222 into main May 15, 2024
@grdsdev grdsdev deleted the fix/crash branch May 15, 2024 10:05
@kevlust
Copy link

kevlust commented May 15, 2024

@grdsdev you're awesome. Thanks for coming up with this fix so quickly!

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.

App crashes with error: pointer being freed was not allocated Random crash from Supabase code right after app launch

4 participants