Skip to content
Source
Sign inSign up
TanStack/db

Fix beforeRetry hook: scheduler not cleared after filtering transactions #1064

Closedtobacode(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/1064/headopened

🎯 Changes

When the beforeRetry hook filters out transactions during loadPendingTransactions(), those filtered transactions are removed from the outbox but remain in the scheduler. This causes them to be executed anyway, even though they were explicitly filtered out.

Solution Clear the scheduler before reloading transactions.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).
    1. 🦋 Changeset detected

      Latest commit: cadc63f7568afdfa790c3d5de1d9a320a4e926da

      The changes in this PR will be included in the next version bump.

      This PR includes changesets to release 1 package
      NameType
      @tanstack/offline-transactionsPatch

      Not sure what this means? Click here to learn what changesets are.

      Click here if you're a maintainer who wants to add another changeset to this PR

    2. Thanks for identifying the retry-hook scheduler mismatch. #1837 now removes excluded pending transaction IDs from scheduler work while retaining already issued work, with replay coverage. Closing this superseded PR.

Sign in to join this conversation.