Closed jens-concordium closed 2 years ago
How to reproduce:
iPhone SE - iOS 14.8.1 Testnet Mobile Wallet 1.0.7 and 1.2.33
Install 1.0.7 Testnet Mobile Wallet and set it up with account and ID
Validate app version and export Concordium ID to iPhone
Make iCloud backup and restore iPhone from the backup
Install the latest Testnet Mobile Wallet from Test Flight and import Concordium ID
Validate ID, attempt to transfer CCDs
NOTES: I could see that there was something wrong with the timestamp on the iCloud backup. I have made the backup 07/02/22 - 22:00 but when restoring the latest backup is from 13:00 which is the same backup but the time zone seems off.
First time I have reproduced the issue, I could see that something was wrong with the import. Import has failed.After I have restarted the application, I was able to import but the issue as above described was still here. All the 29 steps above was the second attempt.
Attachments: Video1 - Before restoring iPhone: Video1 Video2 - After restoring iPhone: Video2
So it confirms our suspicion that the previous fix only applies to the normal import (via More > Import) but not to the initial import (directly after installation of app).
Additionally, we must look into why it validates correctly in step 25.
Bug Description
This bug is potentially related to the missing keys problem caused by restoring an iOS device from an iCloud backup.
Recap of the iCloud backup problem, as background info: If a user had the Concordium wallet while creating a backup of the whole iOS device to iCloud, all data from the Concordium wallet would be kept in the backup except keys. After restoring an iOS device from the iCloud backup, it would look like the accounts and identities were still there, but they couldn't be used for anything, because the keys were not here. Importing an old backup on top of the accounts and IDs with no keys wouldn't help, as the wallet saw them as duplicates, hence not importing the keys from the backup.
Part of the fix for the problem, was to let the wallet check if keys existed for accounts and IDs, and then let the user know about it. The affected accounts would be marked as "read-only", as that would allow the wallet to import the keys from a valid backup, without seeing the accounts as duplicates
The potential new problem: We've received a report from a user who had bought a new iPhone, which was then setup via an iCloud backup that contained an earlier version of the wallet. After restoring the phone, the Concordium wallet was updated to the newest version and the user imported a valid backup on top of what existed in the wallet after the phone restore.
The keys for the users accounts and IDs were added as intended, and everything seemed to be okay, except when the user tried to make a transfer from the account. The user was then met by the same error as for the previous iCloud problem: "An error occured". This indicated that the keys might still be missing.
Using the validation option in the More menu, the app let the user know that everything should be fine. A new export made from the wallet even had a size of 71kB, so that seemed to contain everything as well.
The identity could be used to make more accounts, so those keys were functioning properly.
Lastly, the user tried to update the passcode, but that didn't work, which could indicate that there are still a problem with some of the keys.
So all in all, it seems like the keys are imported in 1.2(33), but for some reason they might not work properly for some accounts.
We need to investigate what exactly is happening with the keys for those accounts.
Versions