@Emil I found something else when tweaking @jitmo's timeout function, but it appears to be a flic documentation issue:
ir.cancelRecord() results in a "TypeError: not a function" message , even though the Hub SDK documentation says it's a valid method; I think the correct method is actually ir.cancel().
(...but please, correct me if I'm wrong!)