Skip to content

Commit

Permalink
Improve message for unsupported stable memory version (#2389)
Browse files Browse the repository at this point in the history
Improve the error message if an II release is installed on a canister
with incompatible stable memory layout.
  • Loading branch information
frederikrothenberger authored Mar 27, 2024
1 parent 851692b commit 6bcf6d6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/internet_identity/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ impl<M: Memory + Clone> Storage<M> {
if &header.version < SUPPORTED_LAYOUT_VERSIONS.start() {
trap(&format!(
"stable memory layout version {} is no longer supported:\n\
Either reinstall (wiping stable memory) or migrate using a previous II version\n\
Either reinstall (wiping stable memory) or upgrade sequentially to the latest version of II by installing each intermediate version in turn.\n\
See https://github.com/dfinity/internet-identity#stable-memory-compatibility for more information.",
header.version
));
Expand Down
2 changes: 1 addition & 1 deletion src/internet_identity/tests/integration/stable_memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ fn should_trap_on_old_stable_memory() -> Result<(), CallError> {
CallError::Reject(err) => panic!("unexpected error {err}"),
CallError::UserError(err) => {
assert_eq!(err.code, CanisterCalledTrap);
assert!(err.description.contains("stable memory layout version 1 is no longer supported:\nEither reinstall (wiping stable memory) or migrate using a previous II version"));
assert!(err.description.contains("stable memory layout version 1 is no longer supported:\nEither reinstall (wiping stable memory) or upgrade sequentially to the latest version of II by installing each intermediate version in turn"));
}
}
Ok(())
Expand Down

0 comments on commit 6bcf6d6

Please sign in to comment.