Skip to content
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: useScaffoldEventHistory caching #916

Merged
merged 3 commits into from
Aug 26, 2024

Conversation

rin-st
Copy link
Member

@rin-st rin-st commented Aug 25, 2024

Description

Fixes useScaffoldEventHistory caching

Fixes #903

Additional Information

Copy link
Collaborator

@technophile-04 technophile-04 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohh I think the main underlying problem was I missed adding filters in queryKey :

queryKey: [
"eventHistory",
{
contractName,
address: deployedContractData?.address,
eventName,
fromBlock: fromBlock.toString(),
chainId: targetNetwork.id,
},

Since we didn't had filters in query key react-query was treating both queries as same and hence not respecting the filters provided.

@technophile-04
Copy link
Collaborator

Just pushed commits to updated here is the demo fixing mrr mentioned here

Screen.Recording.2024-08-26.at.12.14.50.PM.mov

@rin-st
Copy link
Member Author

rin-st commented Aug 26, 2024

Can't approve my own PR 😄 . Thank you for update, lgtm!

Copy link
Collaborator

@technophile-04 technophile-04 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging this 🙌

@technophile-04 technophile-04 merged commit 5d0bf4c into main Aug 26, 2024
1 check passed
@technophile-04 technophile-04 deleted the fix-use-scaffold-event-history-caching branch August 26, 2024 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

useScaffoldEventHistory uses data from old fetch with different filters
2 participants