Skip to content

@tanstack/offline-transactions@1.1.1

Choose a tag to compare

@github-actions github-actions released this 14 Oct 03:13
· 3 commits to main since this release
Immutable release. Only release title and notes can be modified.
93a4727

Patch Changes

  • A failed auto-commit of an offline transaction no longer causes an unhandled promise rejection. mutate() with autoCommit (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 reached unhandledRejection. The offline transaction now passes autoCommit to its TanStack DB transaction, which reports the failure through when('settled') without an unhandled rejection. The extra Auto-commit failed: console error is gone. (#2090)

    createOfflineAction also commits through the TanStack DB auto-commit and no longer prints debug messages (createOfflineAction 2, mutate, offlineAction committed) to the console.

  • waitForTransactionCompletion now settles for an offline transaction whose mutate() 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 when rollback() 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, createOfflineTransaction returns a plain transaction that the executor does not track, so waitForTransactionCompletion does 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