Repository navigation
@tanstack/offline-transactions@1.1.1
Patch Changes
-
A failed auto-commit of an offline transaction no longer causes an unhandled promise rejection.
mutate()withautoCommit(the default) committed through its own copy of the auto-commit logic, which logged the failure and then rethrew it inside a.catch, so every failed auto-commit reachedunhandledRejection. The offline transaction now passesautoCommitto its TanStack DB transaction, which reports the failure throughwhen('settled')without an unhandled rejection. The extraAuto-commit failed:console error is gone. (#2090)createOfflineActionalso commits through the TanStack DB auto-commit and no longer prints debug messages (createOfflineAction 2,mutate,offlineAction committed) to the console. -
waitForTransactionCompletionnow settles for an offline transaction whosemutate()callback writes nothing. Such a transaction completes without running its mutation function, so before this change the executor never settled its waiter, and the promise stayed pending forever. It also settles for a transaction that is rolled back before it commits: the waiter rejects with the rollback's error, or with an Error that names the rollback whenrollback()gives none. A transaction rolled back while it persists still reports the executor's outcome. A callback that throws still leaves its transaction pending, as a core transaction does, so its waiter also stays pending until the transaction commits. (#2100)On a tab without offline leadership,
createOfflineTransactionreturns a plain transaction that the executor does not track, sowaitForTransactionCompletiondoes not apply there. -
waitForTransactionCompletion(id)no longer waits forever for a transaction that the executor already settled. Such a waiter now rejects with an error that says the transaction already settled. The executor remembers the last 1,000 transactions it settled. A waiter for an id that the executor does not know yet keeps waiting, because another tab can still queue that transaction. (#2105) -
Remove the no-op telemetry wrappers that remained after telemetry was removed. No behavior change is intended. Some operations can settle in fewer microtasks because the wrappers no longer add awaits. (#2133)
-
Updated dependencies [
cda9d6a,2f928e6,dfec42e,1a65c2c,1b4ee8d,bbbf017,bc6f30e,fade2e2,bbe9327,b34a579,6fa60aa,f84387c,be4a3d6,0dc696a,fd13e3c]:- @tanstack/db@0.14.0