{"record":{"id":"2efe3c8e4716ac55","repo":"beemdevelopment/Aegis","slug":"unsupported-version","errorCode":null,"errorMessage":"Unsupported version","messagePattern":"Unsupported version","errorType":"exception","errorClass":"VaultException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/com/beemdevelopment/aegis/vault/Vault.java","lineNumber":62,"sourceCode":"            obj.put(\"entries\", entriesArray);\n            obj.put(\"groups\", groupsArray);\n            obj.put(\"icons_optimized\", _iconsOptimized);\n\n            return obj;\n        } catch (JSONException e) {\n            throw new RuntimeException(e);\n        }\n    }\n\n    public static Vault fromJson(JSONObject obj) throws VaultException {\n        Vault vault = new Vault();\n        UUIDMap<VaultEntry> entries = vault.getEntries();\n        UUIDMap<VaultGroup> groups = vault.getGroups();\n\n        try {\n            int ver = obj.getInt(\"version\");\n            if (ver > VERSION) {\n                throw new VaultException(\"Unsupported version\");\n            }\n\n            if (obj.has(\"groups\")) {\n                JSONArray groupsArray = obj.getJSONArray(\"groups\");\n                for (int i = 0; i < groupsArray.length(); i++) {\n                    VaultGroup group = VaultGroup.fromJson(groupsArray.getJSONObject(i));\n                    if (!groups.has(group)) {\n                        groups.add(group);\n                    }\n                }\n            }\n\n            JSONArray array = obj.getJSONArray(\"entries\");\n            for (int i = 0; i < array.length(); i++) {\n                VaultEntry entry = VaultEntry.fromJson(array.getJSONObject(i));\n                if (vault.migrateOldGroup(entry)) {\n                    vault.setGroupsMigrationFresh();\n                }","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/beemdevelopment/Aegis/blob/d6f4e5925a97e4e91593f1542085eae03432a759/app/src/main/java/com/beemdevelopment/aegis/vault/Vault.java#L44-L80","documentation":"Vault.fromJson throws VaultException when the serialized vault's \"version\" field is greater than the VERSION this app build supports. This is a forward-compatibility guard: a vault written by a newer Aegis version must not be loaded, since downgrading could silently drop or misinterpret newer data. It fires when a user restores a backup or migrates a vault from a newer app release.","triggerScenarios":"Thrown at app/src/main/java/com/beemdevelopment/aegis/vault/Vault.java:62 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Catch the VaultException for unsupported version and show a dialog telling the user the vault was created by a newer Aegis version","Check obj.getInt(\"version\") against Vault.VERSION before parsing and throw a dedicated VaultVersionException with the found and supported versions","Refuse to import/export across incompatible versions and direct users to update the app before opening the vault","Add a migration path when a newer schema is intentionally supported, bumping VERSION and converting old fields"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d6f4e5925a97e4e91593f1542085eae03432a759","analyzedAt":"2026-09-08T00:46:31.111Z","contentChangedAt":"2026-09-08T00:46:31.111Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}