What happens if I send cycles to a function and it throws/errors after the remote canister has accepted the cycles? Do I get them back? Or are they gone?
I’m concerned about a scenario where I keep track of an amount of cycles that a user can claim, and then when I try to send them they accept them and then purposely await something for a state change and then throw before returning. Should I update their balance before or after I send the cycles? If before then if something breaks like a network error they would lose their balance? Maybe I should wrap the wallet call in a try/catch? Would that allow me to recover? What if they overrun the cycle limit and I can’t continue processing?