You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using useScaffoldWatchContractEvent with a watched hook or useScaffoldEventHistory, onLogs doesn't fire or fire sometimes. Tried to make it work, but no luck in hardhat and foundry, on sepolia it works from time to time. But onError from useScaffoldWatchContractEvent fires often.
Also tried to make an app without <ScaffoldApp> wrapper to minimize rerenders and logic that can cause the bug, used pure wagmi hook useWatchContractEvent and watcheduseBalance on hardhat. Result - onLogs fires sometimes, but not in 100% of cases. So looks like it's on wagmi side. Raised an issue .
Probably I'm missing something, so if you know what's wrong please let me know
Expected Behavior
onLogs fires in 100% cases
Steps To Reproduce
Example of app without scaffold hooks (based on sre challenge 3). You'll need to start second app on localhost:3001 and send eth to your account from localhost:3000
Example 2 with our hooks. Challenge 3 with wagmi v2 (working on this)
If I understood correctly, I think this is not a bug on Scaffold-ETH nor Wagmi nor Viem but a shortcoming of free public RPC providers which don't store event filters forever and sometimes not even at all.
So maybe this issue should be closed?
Or perhaps some documentation (which?) could be enhanced to warn users about this shortcoming?
Is there an existing issue for this?
Which method was used to setup Scaffold-ETH 2 ?
git clone, npx create-eth@latest
Current Behavior
When using
useScaffoldWatchContractEvent
with a watched hook oruseScaffoldEventHistory
,onLogs
doesn't fire or fire sometimes. Tried to make it work, but no luck inhardhat
andfoundry
, onsepolia
it works from time to time. ButonError
fromuseScaffoldWatchContractEvent
fires often.Also tried to make an app without
<ScaffoldApp>
wrapper to minimize rerenders and logic that can cause the bug, used purewagmi
hookuseWatchContractEvent
and watcheduseBalance
onhardhat
. Result -onLogs
fires sometimes, but not in 100% of cases. So looks like it's onwagmi
side. Raised an issue .Probably I'm missing something, so if you know what's wrong please let me know
Expected Behavior
onLogs
fires in 100% casesSteps To Reproduce
Example of app without scaffold hooks (based on sre challenge 3). You'll need to start second app on localhost:3001 and send eth to your account from localhost:3000
Example 2 with our hooks. Challenge 3 with wagmi v2 (working on this)
Anything else?
see also last part of Shiv's message #700 (comment)
The text was updated successfully, but these errors were encountered: