I have a system in place to submit transaction using
const transaction = await Moralis.executeFunction(sendOptions);
const receipt = await transaction.wait(1);
This smartContract function emits an Event that I monitor using a LiveQuery which updates my App. I am finding on Polygon Mumbai that the live Query picks up an event 5-10 seconds BEFORE the wait function has finished. ie. the receipt is very often generated several seconds AFTER the live query has picked up an event generated by the contract.
Do you have an explanation for this? Does this mean that events picks up yet unapproved transactions?
Or alternatively, is .wait(1) somehow slow ?
This is important because, on my DAPP, the website actually updates quite quickly thanks to the event but I am not giving back control because apparently .wait is not finished, which is weird from a user perspective.