https://linear.app/comm/issue/ENG-9985/deep-link-qr-code-navigation-doesnt-work-when-app-is-killed
Here is what happens:
- user scans the qr code with camera app
- the app starts
- redux store is not yet loaded but we get an initialUrl (that's why when app is in the background it works)
- because redux store is not yet loaded getOwnPeerDevices returns an empty list
- so checkIfPrimaryDevice returns false immediately
- because checkIfPrimaryDevice doesn't run getAuthMetadata, we're trying to navigate before navigation is ready: I don't know exactly what's happening here but it looks like waiting for getAuthMetadata fixes navigate() and without it we're not navigating to any screen
- also we're trying to navigate to a wrong screen
waiting for loading redux store fixes the issue