Bug Description
Import Backup in settings does nothing when clicking the Import button in the confirmation dialog. No success/error dialog appears, and no changes are applied. This affects all versions tested (v2026.04.26 through v2026.07.12).
Steps to Reproduce
- Export a backup from LTvLauncher settings
- Click Import Backup
- Select a backup file from the list
- Click Import in the confirmation dialog
- The dialog closes but nothing happens - no success/error message, no categories changed
Root Cause
In backup_restore_page.dart, the _confirmFileImport method calls _import(context, ...) after popping the confirmation dialog with Navigator.of(dialogContext).pop(). However, popping the dialog deactivates the parent widget context, so when _import() calls context.read<BackupService>(), Flutter throws:
Looking up a deactivated widget's ancestor is unsafe.
Since _import() is called without await, this becomes an unhandled async exception that is silently swallowed - no error dialog is shown.
Debug Evidence
Added logging and confirmed:
[LTV_DEBUG] _confirmFileImport called for backup.json
[LTV_DEBUG] Import button pressed
[LTV_DEBUG] _import called, mounted=false
[LTV_DEBUG] _import FAILED: Looking up a deactivated widget's ancestor is unsafe.
[LTV_DEBUG] context.mounted=false
Suggested Fix
Read service providers (BackupService, SettingsService, AppsService) before showing the confirmation dialog while the context is still valid, then call importBackup() directly without relying on the widget context.
See PR: #112
Bug Description
Import Backup in settings does nothing when clicking the Import button in the confirmation dialog. No success/error dialog appears, and no changes are applied. This affects all versions tested (v2026.04.26 through v2026.07.12).
Steps to Reproduce
Root Cause
In
backup_restore_page.dart, the_confirmFileImportmethod calls_import(context, ...)after popping the confirmation dialog withNavigator.of(dialogContext).pop(). However, popping the dialog deactivates the parent widget context, so when_import()callscontext.read<BackupService>(), Flutter throws:Since
_import()is called withoutawait, this becomes an unhandled async exception that is silently swallowed - no error dialog is shown.Debug Evidence
Added logging and confirmed:
Suggested Fix
Read service providers (
BackupService,SettingsService,AppsService) before showing the confirmation dialog while the context is still valid, then callimportBackup()directly without relying on the widget context.See PR: #112