openwallet-foundation / bifold-wallet

Aries Mobile Agent React Native - Part of the Aries Bifold effort to provide SSI capabilities in a production ready app.
Apache License 2.0
146 stars 140 forks source link

fix: fixed error during deeplink on wallet timeout #1160

Closed wadeking98 closed 3 months ago

wadeking98 commented 3 months ago

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.

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.

sonarcloud[bot] commented 3 months ago

Quality Gate Passed Quality Gate passed

Issues
3 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
1.0% Duplication on New Code

See analysis details on SonarCloud