-
Notifications
You must be signed in to change notification settings - Fork 564
Fix CheckoutWidget transaction invalidation and NFT filtering in connect UI #7761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix CheckoutWidget transaction invalidation and NFT filtering in connect UI #7761
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: 0cb1948 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 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 |
""" WalkthroughThis change updates NFT and token fetching logic to support querying multiple contract or token addresses at once, adjusts cache key construction for transaction details to use a full serialized transaction, and broadens cache invalidation to include NFTs and tokens. NFT filtering in the connect UI is now performed server-side. Changes
Sequence Diagram(s)sequenceDiagram
participant UI as ConnectWallet UI
participant Hook as useQuery Hook
participant Insight as getOwnedNFTs (Insight API)
participant Server as Thirdweb Backend
UI->>Hook: Query NFTs with supported contractAddresses
Hook->>Insight: getOwnedNFTs({ contractAddresses: [...] })
Insight->>Server: Fetch NFTs for owner, filtered by contractAddresses
Server-->>Insight: Return filtered NFTs
Insight-->>Hook: Return NFTs
Hook-->>UI: Provide NFTs (already filtered)
sequenceDiagram
participant Widget as CheckoutWidget
participant Hook as useTransactionDetails
participant Cache as React Query Cache
Widget->>Hook: Request transaction details (with transaction object)
Hook->>Cache: useQuery([stringify(transaction)], ...)
Cache-->>Hook: Return cached or fetch new transaction details
Hook-->>Widget: Provide up-to-date transaction info
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15 minutes Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes were found. All modifications are directly related to the stated objectives in the linked issue. Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (8)
🚧 Files skipped from review as they are similar to previous changes (8)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
4ec515b
to
0cb1948
Compare
size-limit report 📦
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #7761 +/- ##
==========================================
- Coverage 56.42% 56.40% -0.02%
==========================================
Files 904 904
Lines 58665 58674 +9
Branches 4133 4136 +3
==========================================
- Hits 33100 33095 -5
- Misses 25460 25476 +16
+ Partials 105 103 -2
🚀 New features to boost your workflow:
|
Fixes TOOL-5090
PR-Codex overview
This PR focuses on fixing transaction invalidation in the
CheckoutWidget
and enhancing NFT filtering in the connection UI. It updates various functions to support multiple contract addresses and improves query invalidation for wallet balances and NFTs.Detailed summary
getOwnedNFTs
inerc721
anderc1155
to usecontractAddresses
instead ofcontractAddress
.invalidateWalletBalance
to invalidate queries for NFTs and tokens.useTransactionDetails
to stringify the transaction for the query key.getOwnedTokens
to accepttokenAddresses
instead oftokenAddress
.ViewNFTsContent
to filter NFTs based on the active chain and account.getOwnedNFTs
to acceptcontractAddresses
and modified the request payload accordingly.Summary by CodeRabbit
Bug Fixes
New Features
Improvements