-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed as not planned
Labels
needs reproductionMisc: Needs ReproductionMisc: Needs Reproduction
Description
Check existing issues
- I checked there isn't already an issue for the bug I encountered.
Viem Version
2.33.2
Current Behavior
Looks like watchEvent internally validates wrong error and doesn't re-initiate the filter if it was uninstalled (latest code):
// If a filter has been set and gets uninstalled, providers will throw an InvalidInput error.
// Reinitialize the filter when this occurs
if (filter && err instanceof InvalidInputRpcError)
initialized = false
emit.onError?.(err as Error)
I am getting InvalidRequestRpcError instead on the onError callback though:
URL: https://base-mainnet.g.alchemy.com/v2/{api_key}
Request body: {"method":"eth_getFilterChanges","params":[filter_id]}
Details: filter not found
Version: viem@2.33.2
InvalidRequestRpcError JSON is not a valid request object.
Expected Behavior
watchEvent should re-create a filter on the next poll if it was uninstalled
Steps To Reproduce
- start listening to watch even
- uninstall it
- keep getting error onError callback
Link to Minimal Reproducible Example
No response
Anything else?
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
needs reproductionMisc: Needs ReproductionMisc: Needs Reproduction