Repository navigation
Conversation
🦋 Changeset detectedLatest commit: f606115 The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
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 |
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a history receipt request starts before the pending-transaction watcher for the same hash, both use
['tx-receipt', chainId, hash]. TanStack Query deduplicates the in-flight request and never invokes the watcher's query function. The receipt arrives, but the persisted transaction remains pending; its mined callback and balance invalidations never run.Give the lifecycle watcher its own query namespace. History receipts keep their existing keys and public API. This does not change receipt failure, timeout, or cancellation semantics.
Two regressions exercise the collision with a real
QueryClient, an in-flight history request, and the actual watcher/store: both successful and reverted receipts incorrectly stay pending on the base revision. With this fix they record the corresponding outcome and fire the mined callback once; only success invalidates balances.Validation:
master: 29 files, 134 tests passed.pnpm --filter @cofhe/react check:typespassed.git diff --checkpassed.Revalidated after merging current
master(88fcba3): the receipt-history collision regressions and all 134 React unit tests, React TypeScript and changed-file ESLint checks passed. Formatting andgit diff --checkpassed. New GitHub Actions runs require maintainer approval for the fork; local verification does not imply those runs have completed.Note
Medium Risk
Changes query caching for pending tx tracking, which affects store updates and balance refreshes on mine, but scope is narrow and covered by new regression tests.
Overview
Fixes a race where transaction history and
CofheProvider's pending watcher shared the TanStack Query key['tx-receipt', chainId, hash]. When history started first, deduplication meant the watcher'squeryFnnever ran, so mined txs could stay pending, skiponTransactionMined, and skip balance invalidations.The lifecycle watcher now uses
['pending-tx-receipt', chainId, hash]so its side effects always run; history keepstx-receiptand unchanged public behavior.New parameterized tests simulate an in-flight history
fetchQueryplus the watcher and assert confirmed/failed status, a single mined callback, and invalidation only on success.Reviewed by Cursor Bugbot for commit 0a88bc1. Bugbot is set up for automated code reviews on this repo. Configure here.