From 87b7eccb6a24c884057c0945dde6278185f6e6ee Mon Sep 17 00:00:00 2001 From: matejcik Date: Wed, 12 Feb 2025 10:21:06 +0100 Subject: [PATCH] fix(core): do not use local import for RecoveryAborted This side-steps a double-import problem that is triggered when we perform an unimport in a particularly unfortunate order. (don't ask) The root cause of the problem still exists: we can get into a situation where a live recovery_homescreen is running from an unimported module, meaning that any new import of anything from the recovery_device namespace will _also_ be a double-import. We don't have a fix for that situation yet, so instead we avoid this particular local import, which would cause homescreen_dialog to have its own copy of the `recover` module. --- core/.changelog.d/3503.fixed | 1 + core/src/apps/management/recovery_device/layout.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 core/.changelog.d/3503.fixed diff --git a/core/.changelog.d/3503.fixed b/core/.changelog.d/3503.fixed new file mode 100644 index 0000000000..34ce2e0d64 --- /dev/null +++ b/core/.changelog.d/3503.fixed @@ -0,0 +1 @@ +Fix cancelling device recovery after aborting from Suite. diff --git a/core/src/apps/management/recovery_device/layout.py b/core/src/apps/management/recovery_device/layout.py index 352cf2d47e..c86246e8e3 100644 --- a/core/src/apps/management/recovery_device/layout.py +++ b/core/src/apps/management/recovery_device/layout.py @@ -9,6 +9,8 @@ from trezor.ui.layouts.recovery import ( # noqa: F401 from apps.common import backup_types +from .recover import RecoveryAborted + if TYPE_CHECKING: from typing import Awaitable @@ -175,8 +177,6 @@ async def homescreen_dialog( import storage.recovery as storage_recovery from trezor.ui.layouts.recovery import continue_recovery - from .recover import RecoveryAborted - recovery_type = storage_recovery.get_type() if not await continue_recovery( button_label,