From 685f108f02aa02e7c42dd03e08c71488c70b74cc Mon Sep 17 00:00:00 2001 From: "izaaz.yunus" Date: Fri, 4 Oct 2024 10:59:24 -0700 Subject: [PATCH] fix: don't delete old profile file for backwards compatibility --- .../amplitude/android/migration/IdentityStorageMigration.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/android/src/main/java/com/amplitude/android/migration/IdentityStorageMigration.kt b/android/src/main/java/com/amplitude/android/migration/IdentityStorageMigration.kt index 11fcdc72..f74a0946 100644 --- a/android/src/main/java/com/amplitude/android/migration/IdentityStorageMigration.kt +++ b/android/src/main/java/com/amplitude/android/migration/IdentityStorageMigration.kt @@ -18,7 +18,9 @@ class IdentityStorageMigration( if (identity.deviceId != null) { destination.saveDeviceId(identity.deviceId) } - source.delete() + // Since we are not doing a major version upgrade, keep the old profile file around + // just in case someone decides to rollback back to the older version of the SDK. +// source.delete() } catch (e: Exception) { logger.error("Unable to migrate file identity storage: ${e.message}") }