Hey you need a callback wit the warning to finish before the callback with the expensive operation is fired, since the warning is an output that gets sent only when the entire callback processing finishes.
You can achieve that for example by diverting your trigger (let’s say a button) to a warning callback, and have the warning callback trigger the callback of the heavy process (for example by changing the value of a hidden div).
I have something I’m using for updating the user on the different stages of a heavy process, it’s a bit sneaky but maybe it can give you some ideas - Asynchronous notifications / output console for long callbacks - what do you think about my solution?