5460e6c45135

fix: Align import restore error copy (v2.3.32)

- Match browser wording for wrong backup password, corrupted backup, no entries, and unrecognised formats - Map corrupted PeachScript to corrupted-backup copy instead of no-entries copy - Pin the visible restore messages with tests Verified: ./gradlew compileDebugKotlin testDebugUnitTest --tests com.peachpasswords.ui.vault.ImportParsersTest Verified: ./gradlew testDebugUnitTest :app:assembleDebug lintDebug

time
2026-06-26 09:16 UTC · 4 months ago
machine
koh2
parent
424682531f2f
3 files app/build.gradle+2 −2app/src/main/java/com/peachpasswords/ui/vault/ImportScreen.kt+6 −6app/src/test/java/com/peachpasswords/ui/vault/ImportParsersTest.kt+15 −0
app/build.gradle+2 −2
@@ -16,8 +16,8 @@1616         applicationId "com.peachpasswords"1717         minSdk 261818         targetSdk 3519-        versionCode 23310020-        versionName "2.3.31"19+        versionCode 23320020+        versionName "2.3.32"2121 2222         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"2323         vectorDrawables {

view file

app/src/main/java/com/peachpasswords/ui/vault/ImportScreen.kt+6 −6
@@ -95,12 +95,12 @@9595 }9696 9797 object ImportErrors {98-    const val UNRECOGNISED = "This doesn't look like a PeachScript export."99-    const val WRONG_PASSWORD = "Incorrect backup password."100-    const val CORRUPTED = "This export appears to be corrupted."101-    const val NO_ENTRIES = "No entries found in this export."98+    const val UNRECOGNISED = "This doesn't look like PeachScript. Make sure you copied the entire backup string."99+    const val WRONG_PASSWORD = "Wrong backup password. This is the password you chose when you created the backup."100+    const val CORRUPTED = "This Peach backup file looks corrupted or incomplete."101+    const val NO_ENTRIES = "No importable password entries were found in that file."102102     const val UNREADABLE_FILE = "Couldn't read that file."103-    const val UNRECOGNISED_FILE = "Unrecognised file format."103+    const val UNRECOGNISED_FILE = "Unrecognised file format. Use CSV, Bitwarden JSON, Proton Pass JSON/CSV, or a Peach encrypted backup."104104 }105105 106106 internal fun shouldRouteFileToPeachScript(path: String?, content: String): Boolean {@@ -180,7 +180,7 @@180180                 PeachScriptImport.DecryptResult.WrongPassword ->181181                     ImportUiState.Failed(ImportErrors.WRONG_PASSWORD)182182                 PeachScriptImport.DecryptResult.Corrupted ->183-                    ImportUiState.Failed(ImportErrors.NO_ENTRIES)183+                    ImportUiState.Failed(ImportErrors.CORRUPTED)184184             }185185         }186186     }

view file

app/src/test/java/com/peachpasswords/ui/vault/ImportParsersTest.kt+15 −0
@@ -79,4 +79,19 @@7979         assertTrue(shouldRouteFileToPeachScript("backup.peach", "not yet decoded"))8080         assertFalse(shouldRouteFileToPeachScript("export.csv", "name,url,username,password\nA,https://a.com,u,p\n"))8181     }82+83+    @Test fun import_errors_match_browser_recovery_copy() {84+        assertEquals(85+            "Wrong backup password. This is the password you chose when you created the backup.",86+            ImportErrors.WRONG_PASSWORD,87+        )88+        assertEquals(89+            "This Peach backup file looks corrupted or incomplete.",90+            ImportErrors.CORRUPTED,91+        )92+        assertEquals(93+            "No importable password entries were found in that file.",94+            ImportErrors.NO_ENTRIES,95+        )96+    }8297 }

view file