You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HTTP sync stream has no idle timeout, so a silently dead stream is never detected (Capacitor) #1208
On the HTTP connection method, the sync stream only times the connect (connectTimeoutMs; in AbstractRemote.ts on main: "The timeout ends once the response starts, so it never aborts the response body."). Once the response body is streaming, a stream that dies silently (a network change, a proxy or NAT dropping it) is never noticed: the client keeps reporting connected and receives nothing until something else makes it reconnect.
The service sends a keepalive line on an idle stream about every 20 s, so an idle timeout of about 30 s on the response body would catch this. The WebSocket transport already does this (SOCKET_TIMEOUT_MS), and so does the .NET SDK (powersync-ja/powersync-dotnet#18).
It matters most on Capacitor: @powersync/capacitor defaults native platforms to HTTP and warns against WebSocket with CapacitorSQLiteAdapter, so an app kept open in the foreground can sit on a dead stream indefinitely. Possibly related: #1077 (a stream that stays wedged after a long iOS background).
Request: an idle timeout on the HTTP stream's response body that ends the stream and reconnects after retryDelayMs, as the WebSocket path does, ideally configurable.
Versions: @powersync/web 2.6.0, @powersync/common 2.5.0, @powersync/shared-internals 1.5.0, @powersync/capacitor 0.10.0. The current main (shared-internals 1.6.0) still only times the connect.
Activity