#9127·rxdb

A rejected first start() of a replication is unhandled and every later start() rejects with it

Author: sahanxdissanayakeCreated Sep 23, 2026Updated Sep 23, 2026

Failing test: #9126

If the first start() of a replication rejects, the replication does not recover until the page is reloaded:

  • The rejection is unhandled. startReplicationOnLeaderShip() calls start() without a .catch(), so the error goes to the global unhandled-rejection handler and is not emitted on replicationState.error$.
  • Every later start() rejects with the same error after the cause is gone, because start() chains onto the rejected startQueue. With toggleOnDocumentVisible, the visibilitychange handler calls start()/pause() without a catch, so the error is raised again on every tab hide/show.

Seen on iOS Safari after WebKit closes the IndexedDB connection (app backgrounded, airplane mode toggled): the first start() fails in addConnectedStorageToCollection() with ensureNotFalsy() is falsy. The test in #9126 forces the same failure by deleting the collection document from the internal store. It fails on memory and dexie storage.

RxDB 17.5.0.