#Getting a sync timeout error with electric collections

7 messages · Page 1 of 1 (latest)

dusty moat
#

I'm using tanstack-db and electric collections in an expo app and I think its working fine. However, the sync connection seems to be timing out after the initial sync:

[extraction_job] Sync response: 200 OK
[extraction_job] Syncing complete
[/api/electric extraction_job] Syncing to Electric...

Metro error: Request timed out

Call Stack
  ClientRequest.emit (node:events)
  TLSSocket.emitRequestTimeout (node:_http_client)
  Object.onceWrapper (node:events)
  TLSSocket.emit (node:events)
  TLSSocket.Socket._onTimeout (node:net)
  listOnTimeout (node:internal/timers)
  processTimers (node:internal/timers)
[/api/electric extraction_job] Syncing to Electric..```

From here on out, the request continues to time out but among the timeouts there will be a successful sync after some time. This could be a side effect of using it with expo but wondering if anyone had an idea.
plain heron
#

is this in dev or production?

dusty moat
#

This is in dev. I'm using an auth proxy and pointing to an electric cloud url

plain heron
#

Does the request restart?

#

Maybe the expo timeout is pretty low? Cloud does 40 second long polls

dusty moat
#

Yeah it'll keep trying and succeed in between

...

Call Stack
  ClientRequest.emit (node:events)
  TLSSocket.emitRequestTimeout (node:_http_client)
  Object.onceWrapper (node:events)
  TLSSocket.emit (node:events)
  TLSSocket.Socket._onTimeout (node:net)
  listOnTimeout (node:internal/timers)
  processTimers (node:internal/timers)
[/api/electric extraction_job] Syncing to Electric...
[extraction_job] Sync response: 200 OK // succeeds here again
[extraction_job] Syncing complete
[/api/electric extraction_job] Syncing to Electric...

Metro error: Request timed out

Call Stack
  ClientRequest.emit (node:events)
  TLSSocket.emitRequestTimeout (node:_http_client)
  Object.onceWrapper (node:events)
  TLSSocket.emit (node:events)
  TLSSocket.Socket._onTimeout (node:net)
  listOnTimeout (node:internal/timers)
  processTimers (node:internal/timers)
[/api/electric extraction_job] Syncing to Electric...
plain heron
#

yeah sounds like expo's fetch is timing out