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
A throwing transform drops changes from sql.subscribe() #24
sql.subscribe() decodes replication rows with the pool's transform (for example transform.row.from). If a transform throws, the error goes through errored() on the replication connection: it logs "Unexpected error during logical streaming - reconnecting", reconnects on a new slot, and the changes in flight are lost.
Reproduced during the #13 review: with a throwing transform.row.from, both inserted rows were lost, including one inserted 300 ms after the throw.
For a query, a throwing transform is that query's own error and rejecting it is right. A subscription has no query to reject, so the throw should not reach the stream. Options: guard the decode per change and rethrow as an uncaught exception, as #13 does for subscribe callbacks; or deliver the error to the subscription's onerror.
A transform that throws while a change is decoded skips that change; the replication stream keeps going (no reconnect, nothing else lost).
The error goes only to the subscribers that would have received the change: matched by command and table. Subscriptions filtered by key (=id) get it for their table, since the key comes from the transformed row.
Activity
okomarov commentedon Oct 11, 2026
Decided for 4.4.0:
=id) get it for their table, since the key comes from the transformed row.onerroris called if it passed one; if any matching subscriber has noonerror, the error is rethrown once as an uncaught exception, as [FIXED in 4.4.0] A throwing user callback breaks connection state #13 does for callbacks.onerrorstays attached across reconnects (today it is bound to the stream that existed at subscribe time).onerror(connection errors and changes that could not be decoded; the change is skipped and the subscription continues).onerrorused to get a console message and a reconnect; its process can now exit on the uncaught exception.test: bound sql.subscribe() delivery waits by wall-clock time inside …
chore: release 4.4.0