Skip to content
Source
Sign inSign up
TanStack/db
Open History to see the last commit

CHANGELOG.md

624 lines36.0 KB

@tanstack/offline-transactions

1.0.63

Patch Changes

1.0.62

Patch Changes

1.0.61

Patch Changes

  • Updated dependencies [06cab6f]:
    • @tanstack/db@0.11.3

1.0.60

Patch Changes

1.0.59

Patch Changes

  • Reject offline transactions that lose leadership before outbox admission so optimistic changes roll back instead of reporting false success. (#1966)

  • Wait for acknowledged outbox deletion before reporting a successful offline transaction. Persist fulfilled and permanently rejected provider outcomes so a fresh executor can remove a marked row without calling the provider again. If a phase write or deletion fails, reject the affected caller, stop the executor, and leave queued work untouched. Keep active callers from hanging after manual outbox removal. (#1968)

  • Updated dependencies [a18f63d, e706483, 18abcee, d2690bf, 5b85af0, 1dbf5f9, 7ab48d8, d2690bf, 7ca38db, f2f92c5]:

    • @tanstack/db@0.11.1

1.0.58

Patch Changes

  • Add browser-first SQLite persistence and offline transaction guides. Explain how Collection storage, sync, and the durable outbox work together. (#1938)

  • Allow visible web tabs to attempt offline transaction replay even when navigator.onLine reports false, while preserving the connectivity hint for background tabs. (#1879)

  • Reduce work when bulk retry updates and filtered replay process large offline outboxes. Keep FIFO order and the same retained transactions. (#1958)

  • Updated dependencies [9c62ac3, d5e4732, 0122da8, f7d96f7, fb509ef, dc4b4e0, f158258, c879ba6, b5d92ce]:

    • @tanstack/db@0.11.0

1.0.57

Patch Changes

  • Fix offline replay filtering so it preserves concurrently admitted and issued transactions, wait for React Native's subscribed connectivity snapshot before reporting online, and preserve Temporal scalar identity through storage and restart when the runtime provides globalThis.Temporal. Filtered replay work now settles and rolls back after each successful durable removal even when a sibling removal fails, while a failed filtered-work cleanup no longer aborts unrelated startup replay. Successful and permanently failed provider work settles its own caller even when durable cleanup also fails, retry scheduling remains live when a retry update or permanent-failure removal fails, and metadata keeps standard toJSON(key) replacement semantics. Recognized native scalars now fail before storage when the matching global constructor is unavailable. (#1837)

    Offline storage compatibility: new records use valueEncoding: 3. Older clients cannot read these records, so do not run old and new clients against the same pending outbox or downgrade while new records remain pending.

  • Reject cyclic offline transaction values with a bounded error, preserve user objects that only imitate Temporal tags, and avoid allocating an index list for every serialized array. (#1873)

  • Fence each successful outbox clear deletion from overlapping reads, including when another deletion is still pending or fails. (#1836)

  • Preserve only captured accepted local inserts across a truncate. Preserve sparse-array length and RegExp state through ordered-query hashing, including hosts without a global File constructor. Prevent delayed replay reads from rerunning any transaction removed while the read was in flight, without rescanning the outbox. (#1822)

  • Updated dependencies [2ad6834, b528a61, 84fc44b, 9351f46, 5108acf, afbeb44, 2775082, fef53f8, b44a50a, 19dd9a2, 3096b8f, 1ab1cd3, e5fe2ea, 3eb5b2b, 7c62bf5, 63362dc, 7f6b643, c479fdc, 91a2cbf, 144c6b1, 5218f0c, 76d766e, 1e54c6a, d698b90, 04a1a81, 3ad64a4, 4c5a8de, b72b5d1, fc1adde, 2781581, 40a5aea, e16d46c, 9cbc885, 23ae52d, 7917ef9, 1ca838b, 34a999d, 825acc5, febd4bc, b7a7d10, 510cb53, efb84d8, 236d77b, 71ad428]:

    • @tanstack/db@0.10.0

1.0.56

Patch Changes

  • Ignore repeated leadership notifications when the state has not changed to avoid restarting active replay. Settle each transaction's commit when that transaction completes, without waiting for the shared queue to drain. (#1816)

    Keep a completed transaction registered until its outbox deletion settles so a leadership change during deletion does not schedule the same mutation again.

  • Preserve fractional top-k replacements regardless of delta order, including left-join updates, and honor B-tree lookup fallbacks after node splits. Preserve own JSON data properties such as __proto__ during mutation detachment and offline transaction serialization. (#1816)

    Compare same-key top-k values directly instead of hashing every replacement. This preserves cyclic payloads and avoids unnecessary full-payload traversal for ordinary updates.

    Cancel structurally equal mapped top-k deltas before applying replacements. Escape Date-marker-shaped user objects in new offline records while retaining read support for the original record format.

    Offline storage compatibility: new records use valueEncoding: 2. Older clients cannot decode escaped marker-shaped objects correctly, so do not mix old and new clients against the same pending outbox or downgrade while new records remain. New clients still read the original unversioned format. Unknown encodings and corrupt records are reported through warnings and left in storage, not silently discarded; recovery policy is tracked in RFC #1659.

    Reject malformed escaped-object markers rather than inventing empty mutation data. Avoid redundant transfer work for zero-width fractional top-k windows and avoid descriptor writes for ordinary keys during draft copying.

  • Updated dependencies [3c4c35d]:

    • @tanstack/db@0.9.2

1.0.55

Patch Changes

1.0.54

Patch Changes

  • Updated dependencies [cfb01ce]:
    • @tanstack/db@0.9.0

1.0.53

Patch Changes

  • Updated dependencies [bbc9edf]:
    • @tanstack/db@0.8.7

1.0.52

Patch Changes

  • Updated dependencies [ae2fe74]:
    • @tanstack/db@0.8.6

1.0.51

Patch Changes

1.0.50

Patch Changes

1.0.49

Patch Changes

1.0.48

Patch Changes

  • Updated dependencies [c521b5d]:
    • @tanstack/db@0.8.2

1.0.47

Patch Changes

1.0.46

Patch Changes

  • Updated dependencies [4b9e8cd]:
    • @tanstack/db@0.8.0

1.0.45

Patch Changes

  • Update agent skills to match current APIs and behavior. (#1696)

  • Updated dependencies [5f63996]:

    • @tanstack/db@0.7.2

1.0.44

Patch Changes

  • Updated dependencies [424382b]:
    • @tanstack/db@0.7.1

1.0.43

Patch Changes

1.0.42

Patch Changes

  • Updated dependencies [8ee783d]:
    • @tanstack/db@0.6.17

1.0.41

Patch Changes

1.0.40

Patch Changes

1.0.39

Patch Changes

  • Updated dependencies [397e12a]:
    • @tanstack/db@0.6.14

1.0.38

Patch Changes

1.0.37

Patch Changes

  • Updated dependencies [2b27dd1]:
    • @tanstack/db@0.6.12

1.0.36

Patch Changes

1.0.35

Patch Changes

  • Updated dependencies [307fdf8]:
    • @tanstack/db@0.6.10

1.0.34

Patch Changes

  • Use a safe randomUUID helper that falls back to crypto.getRandomValues when crypto.randomUUID is unavailable (non-secure browser contexts such as dev servers reached via a LAN IP over HTTP). Fixes #1541. (#1593)

  • Updated dependencies [2147345, 00389a4]:

    • @tanstack/db@0.6.9

1.0.33

Patch Changes

  • Updated dependencies [3827b62]:
    • @tanstack/db@0.6.8

1.0.32

Patch Changes

1.0.31

Patch Changes

  • Updated dependencies [4e9ab39]:
    • @tanstack/db@0.6.6

1.0.30

Patch Changes

1.0.29

Patch Changes

  • Updated dependencies [1e69dd6]:
    • @tanstack/db@0.6.4

1.0.28

Patch Changes

1.0.27

Patch Changes

1.0.26

Patch Changes

  • Update all SKILL.md files to v0.6.0 with new documentation for persistence, virtual properties, queryOnce, createEffect, includes, indexing, and sync metadata. Add tanstack-intent keyword to all packages with skills. (#1421)

  • Updated dependencies [8b7fb1a]:

    • @tanstack/db@0.6.1

1.0.25

Patch Changes

1.0.24

Patch Changes

  • Updated dependencies [c3e6a96]:
    • @tanstack/db@0.5.33

1.0.23

Patch Changes

1.0.22

Patch Changes

  • Add Intent agent skills (SKILL.md files) to guide AI coding agents. Include skills for core DB concepts, all 5 framework bindings, meta-framework integration, and offline transactions. Also add export * from '@tanstack/db' to angular-db for consistency with other framework packages. (#1330)

  • Updated dependencies [bf1d078]:

    • @tanstack/db@0.5.31

1.0.21

Patch Changes

  • Fix retry behavior to not cap at 10 attempts and not burn retries while offline. Default retry policy now retries indefinitely with exponential backoff. Execution loop and retry timer check online status before attempting transactions. OnlineDetector.isOnline() is now a required method on the interface. OfflineExecutor.notifyOnline() has been removed — the online detector handles connectivity changes automatically. (#1301)

1.0.20

Patch Changes

  • Fix KeyScheduler to enforce strict FIFO ordering on retries. Previously, the scheduler could skip past a transaction waiting for retry and execute a later one, causing dependent UPDATE-before-INSERT failures. Also refactored getNextBatch to getNext to reflect that it always returns at most one transaction. (#1300)

  • Updated dependencies [e9d0fd8]:

    • @tanstack/db@0.5.30

1.0.19

Patch Changes

1.0.18

Patch Changes

  • Updated dependencies [46450e7]:
    • @tanstack/db@0.5.28

1.0.17

Patch Changes

1.0.16

Patch Changes

1.0.15

Patch Changes

1.0.14

Patch Changes

  • Updated dependencies [7099459]:
    • @tanstack/db@0.5.24

1.0.13

Patch Changes

  • Fix optimistic state not being restored to collections on page refresh while offline. Pending transactions are now automatically rehydrated from storage and their optimistic mutations applied to the UI immediately on startup, providing a seamless offline experience. (#1169)

  • Updated dependencies [05130f2]:

    • @tanstack/db@0.5.23

1.0.12

Patch Changes

  • Updated dependencies [f9b741e]:
    • @tanstack/db@0.5.22

1.0.11

Patch Changes

  • Fix date field corruption after app restart. String values matching ISO date format were incorrectly converted to Date objects during deserialization, corrupting user data. Now only explicit Date markers are converted, preserving string values intact. (#1127)

  • Fix mutation.changes field being lost during offline transaction serialization. Previously, the changes field was not included in serialized mutations, causing it to be empty ({}) after app restart. This led to sync functions receiving incomplete data when using mutation.changes for partial updates. (#1124)

  • Introduce specialized OnlineDetector for React Native (#1137)

  • Updated dependencies [6745ed0, 1b22e40, 7a2cacd, bdf9405]:

    • @tanstack/db@0.5.21

1.0.10

Patch Changes

  • Updated dependencies []:
    • @tanstack/db@0.5.20

1.0.9

Patch Changes

1.0.8

Patch Changes

  • Updated dependencies [c1247e8]:
    • @tanstack/db@0.5.18

1.0.7

Patch Changes

  • Fix race condition that caused double replay of offline transactions on page load. The issue occurred when WebLocksLeader's async lock acquisition triggered the leadership callback after requestLeadership() had already returned, causing loadAndReplayTransactions() to be called twice. (#1046)

  • Updated dependencies [f795a67, d542667, 6503c09, b1cc4a7]:

    • @tanstack/db@0.5.17

1.0.6

Patch Changes

  • Updated dependencies [41308b8]:
    • @tanstack/db@0.5.16

1.0.5

Patch Changes

  • Updated dependencies [32ec4d8]:
    • @tanstack/db@0.5.15

1.0.4

Patch Changes

  • Updated dependencies [26ed0aa]:
    • @tanstack/db@0.5.14

1.0.3

Patch Changes

1.0.2

Patch Changes

1.0.1

Patch Changes

  • Use regular dependency for @tanstack/db instead of peerDependency to match the standard pattern used by other TanStack DB packages and prevent duplicate installations (#952)

  • Updated dependencies [c4b9399, a1a484e]:

    • @tanstack/db@0.5.11

1.0.0

Patch Changes

0.1.3

Patch Changes

  • Fix dependency bundling issues by moving @tanstack/db to peerDependencies (#766)

    What Changed:

    Moved @tanstack/db from regular dependencies to peerDependencies in:

    • @tanstack/offline-transactions
    • @tanstack/query-db-collection

    Removed @opentelemetry/api dependency from @tanstack/offline-transactions.

    Why:

    These extension packages incorrectly declared @tanstack/db as both a regular dependency AND a peerDependency simultaneously. This caused lock files to develop conflicting versions, resulting in multiple instances of @tanstack/db being installed in consuming applications.

    The fix removes @tanstack/db from regular dependencies and keeps it only as a peerDependency. This ensures only one version of @tanstack/db is installed in the dependency tree, preventing version conflicts.

    For local development, @tanstack/db remains in devDependencies so the packages can be built and tested independently.

  • Updated dependencies [6c55e16, 7805afb, 1367756]:

    • @tanstack/db@0.4.20

0.1.2

Patch Changes

  • Updated dependencies [75470a8]:
    • @tanstack/db@0.4.19

0.1.1

Patch Changes

0.1.0

Minor Changes

  • Add offline-transactions package with robust offline-first capabilities (#559)

    New package @tanstack/offline-transactions provides a comprehensive offline-first transaction system with:

    Core Features:

    • Persistent outbox pattern for reliable transaction processing
    • Leader election for multi-tab coordination (Web Locks API with BroadcastChannel fallback)
    • Automatic storage capability detection with graceful degradation
    • Retry logic with exponential backoff and jitter
    • Sequential transaction processing (FIFO ordering)

    Storage:

    • Automatic fallback chain: IndexedDB → localStorage → online-only
    • Detects and handles private mode, SecurityError, QuotaExceededError
    • Custom storage adapter support
    • Diagnostic callbacks for storage failures

    Developer Experience:

    • TypeScript-first with full type safety
    • Comprehensive test suite (25 tests covering leader failover, storage failures, e2e scenarios)
    • Works in all modern browsers and server-side rendering environments

    @tanstack/db improvements:

    • Enhanced duplicate instance detection (dev-only, iframe-aware, with escape hatch)
    • Better environment detection for SSR and worker contexts

    Example usage:

    import {
      startOfflineExecutor,
      IndexedDBAdapter,
    } from '@tanstack/offline-transactions'
    
    const executor = startOfflineExecutor({
      collections: { todos: todoCollection },
      storage: new IndexedDBAdapter(),
      mutationFns: {
        syncTodos: async ({ transaction, idempotencyKey }) => {
          // Sync mutations to backend
          await api.sync(transaction.mutations, idempotencyKey)
        },
      },
      onStorageFailure: (diagnostic) => {
        console.warn('Running in online-only mode:', diagnostic.message)
      },
    })
    
    // Create offline transaction
    const tx = executor.createOfflineTransaction({
      mutationFnName: 'syncTodos',
      autoCommit: false,
    })
    
    tx.mutate(() => {
      todoCollection.insert({ id: '1', text: 'Buy milk', completed: false })
    })
    
    await tx.commit() // Persists to outbox and syncs when online

Patch Changes

  • Updated dependencies [49bcaa5]:
    • @tanstack/db@0.4.17