Customers have reported an issue related to the behavior of the commonDBHelper and the onUpgrade function. The issue arises when the commonDBHelper is recalled, and the DB version is directly set to a higher number, bypassing the expected behavior of setting it to a lower version. Consequently, the onUpgrade function is not triggered, leading to data not being moved to the desired database and certain tables not being dropped.
Release : CA Strong Authentication 9.1
The root cause of this issue is a coding error within the commonDBHelper, where the version number is being set incorrectly during the recall process. Instead of setting the DB version to a lower number or the next appropriate version, it is directly set to a higher number.
The impact of this issue is twofold:
To ensure that the onUpgrade function is triggered appropriately and to allow fetching accounts from both the old and new databases (encrypted and non-encrypted), we have modified the version number. Previously, the first execution of the commonDBHelper triggered an update to the latest version, even if the database was not yet updated to the last schema generated by the SDK.
Upon investigating the reported issue, we have identified that when the commonDBHelper is recalled, the DB version is being directly set to 7 instead of the expected behavior of setting it to 6 or a lower version. As a result, the onUpgrade function is not being triggered as intended.
Consequently, the data is not being moved to the real DB AccountsV2, and the tables ArcotOTP and Accounts are not being dropped, which is causing the observed issue.
With the recent modifications, the version number has been adjusted to trigger the onUpgrade function correctly. This enables the retrieval of accounts from both the old and new databases, accommodating encrypted and non encrypted data.
To prevent similar issues in the future, it is recommended to follow these best practices: