-
Notifications
You must be signed in to change notification settings - Fork 198
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
fix(api): propagate connectionLost error from websocket client to sync engine #3800
Conversation
API Breakage Report✅ No Public API Breaking Change detected |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3800 +/- ##
==========================================
+ Coverage 68.52% 68.69% +0.16%
==========================================
Files 1080 1080
Lines 37700 37692 -8
==========================================
+ Hits 25834 25892 +58
+ Misses 11866 11800 -66
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
||
await mockWebSocketClient.setStateToConnected() | ||
Task { | ||
try await Task.sleep(nanoseconds: 80 * 1_000_000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need delays? does it ensure a deterministic flow of events?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, as the websocket is mocked. here is trying to mock the events flow.
Issue #
#3632
Description
When an app using the DataStore plugin switches from foreground to background, the network connection is aborted, and the
URLSessionTaskDelegate
will receive a connection lost error. This error should be propagated back to the remote sync engine to trigger a scheduling restart, ensuring all missing records are retrieved while the app is in the background without a connection.General Checklist
Given When Then
inline code documentation and are named accordinglytestThing_condition_expectation()
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.