Repository navigation
fix: single thread hosts can hang - #1032
Merged
Merged
Conversation
…e handshake." This reverts commit cd4d17f.
Add the ConfigureAwait(false) that master's new awaits lack (CA2007), forward the cancellation token to the session update and notification in the passkey, Web3 and recovery-code sign-ins (CA2016), restore the ConfigureAwait(false) on Realtime.ConnectAsync that the Realtime split removed, and format the Postgrest files the PR touches. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A context that queues work and never runs it, and responses delivered from outside the SDK, stand in for Unity WebGL: a call that captured the context or went through the pool would never finish. Also cover the cancellable wait path of SerialGate. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Rename the private fields of CacheBackedRequest without the underscore prefix and the internal TryLoadFromCache to TryLoadFromCacheAsync, and cover the state it reports. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Bug fix, plus a build change that keeps it fixed.
What is the current behavior?
On single-threaded hosts such as Unity WebGL, the SDK can hang.
ConfigureAwait(false)was missing. Many awaits in the shipped packages captured the caller's synchronization context..Resultor.Wait()under a UI context can deadlock.ConfigureAwait(false)continuation inline and sends it to the pool, where it never runs. That is howSignInWithPasswordfroze on WebGL whileSignUpworked (Gotrue Helpers.MakeRequestAsync<T>).SemaphoreSlimresumes waiters on the thread pool. Gotrue's persistence gate used one, so a contended wait never returned on WebGL.What is the new behavior?
Directory.Build.props,ShippedSdk.globalconfig)packages/. Test projects andCapabilityMatrixare excluded.AnalysisMode=None, so only rules with an explicit severity run.none. All 14 existing hits are in public signatures, where moving theCancellationTokenparameter is a breaking change. This can be revisited in a major version.SerialGate(Gotrue)Release(or from cancellation) with no synchronization context current. Waiters are served in order.Gotrue.Clientnow uses it instead ofSemaphoreSlim. App callbacks are started after the gate is released, so app code never runs under it.SerialGateTests.ConfigureAwait(false)sweepAdditional context