correctly update `state.sending` and handle canceled sends