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()callsstart()without a.catch(), so the error goes to the global unhandled-rejection handler and is not emitted onreplicationState.error$. - Every later
start()rejects with the same error after the cause is gone, becausestart()chains onto the rejectedstartQueue. WithtoggleOnDocumentVisible, thevisibilitychangehandler callsstart()/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.
Source: pubkey/rxdb