Skip to content

Update @electric-sql/client to fix realtime stream aborts after tab visibility changes #4263

Description

@scefali

Problem

Trigger.dev's realtime React hooks currently pull in @electric-sql/client@1.0.14 through @trigger.dev/core. In production we are seeing repeated browser-side unhandled rejections while using useRealtimeRun and useRealtimeBatch:

AbortError: signal is aborted without reason
at PrefetchQueue.abort
  @electric-sql/client@1.0.14/dist/index.mjs

Related events are also reported as:

UnhandledRejection: Non-Error promise rejection captured with value: pause-stream

Across the related Sentry groupings we have observed 314 events affecting 7 users. The errors occur around Trigger.dev realtime requests and tab/subscription lifecycle changes.

Root cause

This appears to be ElectricSQL's stale aborted-prefetch bug:

ElectricSQL describes the failure mode as aborted prefetch promises remaining in the queue and being returned when a stream resumes, causing an AbortError to propagate and stop syncing. The fix clears the prefetch queue after abort and avoids returning aborted requests. It was released starting with @electric-sql/client@1.3.0.

Trigger.dev 4.5.4 still pins @electric-sql/client to 1.0.14 in packages/core/package.json.

Impact

Our application currently has a separate status-polling fallback, so captured generations generally recover. We are moving toward realtime-only status delivery; without the fallback, a stopped stream can leave completed runs stuck in a non-terminal UI state.

We would prefer not to override or patch Trigger.dev's transitive dependency in the application.

Request

Please update @electric-sql/client to a version containing the upstream fix and publish it through a supported Trigger.dev release.

A regression test covering tab hide/show or stream pause/resume with an in-flight prefetched request would also help ensure useRealtimeRun and useRealtimeBatch recover reliably.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions