Replies: 1 comment
-
|
Hey! Thanks for reporting! This is clearly related to #5. I'll open an issue to track them down. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I am experiencing an issue where the Realtime subscription fails to reconnect automatically after a network interruption. It seems like an internal exception in the SseClient or RealtimeService prevents the reconnection logic from triggering properly.
Error Logs
When the connection is lost, the following logs appear in the Unity Console:
Plaintext
Curl error 18: transfer closed with outstanding read data remaining
UnityEngine.Debug:Log (object) Code.PocketBase.PocketBaseManager/<>c:b__56_0 ...
InvalidOperationException: An attempt was made to transition a task to a final state that has already been completed.
System.Threading.Tasks.TaskCompletionSource`1[TResult].SetException (System.Exception exception)
PocketBaseSdk.RealtimeService+<>c__DisplayClass13_0.b__4 (System.Net.WebException e) (at ./Library/PackageCache/com.sov3rain.pocketbase-unity@84deeb07e2c9/Runtime/Services/RealtimeService.cs:348)
PocketBaseSdk.SseClient+d__21.MoveNext () (at ./Library/PackageCache/com.sov3rain.pocketbase-unity@84deeb07e2c9/Runtime/Sse/SseClient.cs:114)
Observed Behavior
A Curl error 18 occurs (likely due to a network hiccup or server timeout).
Instead of silently retrying, the SDK throws an InvalidOperationException at TaskCompletionSource.SetException.
The reconnection coroutine stops entirely, and the application no longer receives realtime updates.
Suspected Cause
It appears that SetException is being called on a TaskCompletionSource that has already been completed or faulted, leading to the InvalidOperationException. This crash in the error handling logic seems to break the automatic reconnection loop.
Beta Was this translation helpful? Give feedback.
All reactions