-
Notifications
You must be signed in to change notification settings - Fork 619
[SDK] Fix useContractEvents persisting previous data when filters change
#7766
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
[SDK] Fix useContractEvents persisting previous data when filters change
#7766
Conversation
🦋 Changeset detectedLatest commit: 59fc826 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 |
|
@alecananian is attempting to deploy a commit to the thirdweb Team on Vercel. A member of the Team first needs to authorize it. |
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. |
WalkthroughA patch was applied to the Changes
Sequence Diagram(s)sequenceDiagram
participant Component
participant useContractEvents
participant Cache
Component->>useContractEvents: Provide event filters (hashes + topics)
useContractEvents->>Cache: Generate cache key (hash + topics)
Cache-->>useContractEvents: Return cached event data (if key matches)
useContractEvents-->>Component: Return event data scoped to current filters
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes found. Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (2)**/*.{ts,tsx}📄 CodeRabbit Inference Engine (CLAUDE.md)
Files:
**/*.{ts,tsx,js,jsx}📄 CodeRabbit Inference Engine (CLAUDE.md)
Files:
🧠 Learnings (3)📓 Common learnings.changeset/witty-ducks-lie.md (3)Learnt from: CR Learnt from: MananTank Learnt from: MananTank packages/thirdweb/src/react/core/hooks/contract/useContractEvents.ts (8)Learnt from: MananTank Learnt from: MananTank Learnt from: CR Learnt from: CR Learnt from: CR Learnt from: CR Learnt from: CR Learnt from: CR 🔇 Additional comments (2)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 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 (
|
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #7766 +/- ##
===========================================
- Coverage 56.42% 36.34% -20.09%
===========================================
Files 904 897 -7
Lines 58674 58177 -497
Branches 4139 2312 -1827
===========================================
- Hits 33108 21142 -11966
- Misses 25461 36963 +11502
+ Partials 105 72 -33
🚀 New features to boost your workflow:
|
Closes #7737
Test code used:
PR-Codex overview
This PR focuses on fixing the
useContractEventshook to ensure it correctly handles changes in filters by updating how event identifiers are generated.Detailed summary
useContractEventsto generate unique identifiers for events.curr.hashwithcurr.topics.join(""), improving how identifiers are formed when filters change.Summary by CodeRabbit