There was a race condition while handling deeplinks after wallet lockout. When handling the deeplink the user would be directed to the application. The app would be in the unlocked state while the rootstack was checking if it should lockout the user if the app has been in the background long enough. Since the app was unlocked and has an active deeplink it would try to process the deeplink, however, if the user is about to be locked out then the agent would be deactivated in the middle of handling the deeplink, which would cause the error.
To fix this issue I added a check to test if the app has recently been in the background, if it has then it will check if the application is about to be locked out. Only then will it begin to process the deeplink
Tick all boxes below to demonstrate that you have completed the respective task. If the item does not apply to your this PR check it anyway to make it apparent that there's nothing to do.
[x] All commits contain a DCO Signed-off-by line (we use the DCO GitHub app to enforce this);
[x] Updated LICENSE-3RD-PARTY.md for any added dependencies or vendored components;
[x] Updated documentation as needed for changed code and new or modified features;
[x] Added sufficient tests so that overall code coverage is not reduced.
If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!
Pro Tip 🤓
Read our contribution guide at least once; it will save you a few review cycles!
Your PR will likely not be reviewed until all the above boxes are checked and all automated tests have passed.
PR template adapted from the Python attrs project.
Summary of Changes
There was a race condition while handling deeplinks after wallet lockout. When handling the deeplink the user would be directed to the application. The app would be in the unlocked state while the rootstack was checking if it should lockout the user if the app has been in the background long enough. Since the app was unlocked and has an active deeplink it would try to process the deeplink, however, if the user is about to be locked out then the agent would be deactivated in the middle of handling the deeplink, which would cause the error.
To fix this issue I added a check to test if the app has recently been in the background, if it has then it will check if the application is about to be locked out. Only then will it begin to process the deeplink
Related Issues
https://github.com/openwallet-foundation/bifold-wallet/issues/1019
Pull Request Checklist
Tick all boxes below to demonstrate that you have completed the respective task. If the item does not apply to your this PR check it anyway to make it apparent that there's nothing to do.
Signed-off-by
line (we use the DCO GitHub app to enforce this);If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!
Pro Tip 🤓
PR template adapted from the Python attrs project.