-
Notifications
You must be signed in to change notification settings - Fork 335
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: [Counterfactual] Call onSubmit handler when submitting a transaction #3555
Conversation
…factual transaction
Branch preview✅ Deploy successful! |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
@@ -65,6 +66,7 @@ export const CounterfactualForm = ({ | |||
// On modal submit | |||
const handleSubmit = async (e: SyntheticEvent) => { | |||
e.preventDefault() | |||
onSubmit?.('mockId') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not ideal but also doesn't break anything. We can adjust the type but we are prop drilling this handler multiple times and will have to change it in all of these places and adjust related logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can it be Math.random()
instead?
📦 Next.js Bundle Analysis for safe-wallet-webThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
Coverage report
Show files with reduced coverage 🔻
Test suite run success1419 tests passing in 198 suites. Report generated by 🧪jest coverage report action from 7901544 |
This fixes the issue mentioned here cowprotocol/cowswap#4063 (comment) |
Tried to swap WETH for USDC and I got a timeout on the tx and now the app is stuck here: The cowSwap app still shows a tx is pending in the UI, but the address never got any order in cowswap at all: Also the link to the tx in the sepolia block explorer is emtpy as well: |
Given Usame's advice I tried again with Rabby and this time it worked. I was able to do the token approval for swapping + safe activation just fine and then tried the swap (the swap end up failing for low amount being swapped, so it was expected) The safe used: So, the ticket is fine, but given that most people use MM they might find the issue I reported first. |
2 similar comments
I will merge this so the CoW team is unblocked but we should follow up on this once Metamask works again. |
What it solves
We didn't call the
onSubmit
handler inCounterfactualForm
so safe apps didn't receive asafeTxHash
when submitting transactions.How this PR fixes it
onSubmit
when submitting inCounterfactualForm
How to test it
Checklist