Skip to content

Automatic migration of entries to new version failed. #107

Closed

Description

@profanek

Describe the bug
After installation of new version 2.0.4 automatic migration of my password failed.
"Your items could not be imported. Nothing was lost, and KeyGo will try again the next time you open it."
Application open and it is empty.

To Reproduce
Steps to reproduce the behavior:

  1. Info of migration
  2. Entering password (biometrics was not possible to use)
  3. Information of import error
  4. App doesn't contain any entries.

Expected behavior
I hope that all passwords and login will be visible in new app version.

Environment information (please complete the following information):

  • Device: [Samsung A56]
  • OS: [Android 16]
  • App Version: [2.0.4]

Additional context
Perhaps the issue is that some individual entries contained longer texts? What can I do to help fix this error? Regaining access to my passwords is very important to me…
Unfortunately, I didn’t have any password backup created.

Activity

  1. profanek commented on Sep 29, 2026

    @profanek
    Author

    I asked Claude about this problem and received some suggestions. I’m pasting his reply — maybe it will be helpful in some way.
    Best regards. Aside from that, thank you for creating such a fantastic app — I really appreciate it.


    Suggested fix for the v1 import failure (IllegalArgumentException in IDN.toASCII)

    Root cause (as far as I can tell from the stack trace)

    The v1 import aborts with v1 import did not finish because java.net.IDN.toASCII throws IllegalArgumentException (The output exceed the max allowed length).

    The input was not a domain at all, but a long multi-line text in the URL/website field of one legacy item (a list of numbered backup codes). The importer seems to derive a registrable domain from that field for autofill. As a result, one malformed entry stops the whole import.

    Suggested changes

    1. Isolate failures per item. Wrap the conversion of each legacy item in try/catch (or runCatching), so a bad row is skipped and reported instead of aborting everything. The PR description mentions per-row failure isolation, but this exception seems to escape it, possibly because it is thrown in a different stage (domain resolution) than the one being guarded.

    2. Make the domain resolution itself safe, for example:

       fun String.toAsciiDomainOrNull(): String? {
           val candidate = trim()
           // A valid DNS name is at most 253 chars, with labels of at most 63 chars.
           if (candidate.isEmpty() || candidate.length > 253 || candidate.any { it.isWhitespace() }) return null
           return try {
               IDN.toASCII(candidate)
           } catch (_: IllegalArgumentException) {
               null
           }
       }

    If the result is null, keep the original text as-is and just skip the autofill domain association for that item.

    1. Do not lose the data. If the field content is not a valid domain, import it unchanged into the note or website field of the new item.

    2. Report skipped items. Add the item to the migration report as a partial failure (e.g. reason INVALID_DOMAIN), so the user can see what was affected.

    3. Add a regression test with a legacy item whose URL field contains a very long, multi-line string, and assert that the import finishes and all other items are imported.

  2. OffRange commented on Sep 29, 2026

    @OffRange
    Owner

    Hey, thanks for the kind words! I am looking into it, hopping to publish an fix asap

  3. OffRange commented on Sep 29, 2026

    @OffRange
    Owner

    Thank you for reporting this! A fix will be merged as soon as the checks on PR #108 pass, and patch version 2.0.5 will be released to the Google Play Store shortly after.

    Important

    To ensure your login credentials remain accessible for the migration step in v2.0.5, please do NOT clear your app data or cache. Simply update the app via the Play Store once the new version is live.

    I appreciate your patience, and apologies for any inconvenience this may have caused!

  4. OffRange commented on Sep 29, 2026

    @OffRange
    Owner

    @profanek I am happy to announce that a patch has been released and you are now able to update. Once you open the app, you should see the migration steps in and all your logins will be recovered.

  5. Repository owner deleted a comment from profanek on Oct 1, 2026
  6. Repository owner deleted a comment from profanek on Oct 1, 2026
  7. profanek commented on Oct 2, 2026

    @profanek
    Author

    @OffRange First, everything works! Thank you! <3 I’m impressed by how quickly you were able to resolve the issue. Great job!

    I use your app to safely store licenses for purchased software as well as two‑step authentication codes. In the new version I will put that information into notes instead of domains. Once again, I really appreciate your help.

  8. profanek commented on Oct 2, 2026

    @profanek
    Author

    @OffRange PS Don’t worry, I randomized some letters and digits in all authentication codes that were visible in the comment. Thank you for deleting the previous comment as a safety measure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions