Create a function that helps us to deal with promises that can time out. It can be used in all the places where we use timeouts, but it's not a good idea to prioritize it now - let's do it incrementally.
https://linear.app/comm/issue/ENG-10209/seeing-error-failed-to-generate-qr-code-message-task-cancelled