-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
Description
Context
Currently, the wrapWithToast function in web/src/utils/wrapWithToast.ts waits indefinitely for transaction receipts using publicClient.waitForTransactionReceipt({ hash, confirmations: 2 }). This could potentially lead to poor user experience if transactions take an unusually long time to be mined.
Suggested Improvement
Add a timeout mechanism that rejects the wait if the transaction receipt is not received within a reasonable time limit (e.g., 5 minutes). This can be implemented by wrapping the waitForTransactionReceipt call in a Promise.race with a timeout promise.
Benefits
- Prevents indefinite waiting
- Improves user experience with clear timeout messaging
- Allows users to take appropriate action if transactions are delayed
Related Discussion
- PR: feat: governor-functionality #10
- Comment: feat: governor-functionality #10 (comment)
- Requested by: @tractorss
This issue was created following a code review suggestion to discuss the implementation approach and timing for this enhancement.