From 6b13aa298d901d322ec596ce63cd31546a3ac7c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antti=20M=C3=A4ki?= Date: Thu, 27 Feb 2025 10:10:36 +0200 Subject: [PATCH] Fix profile import silently leaving some mods uninstalled To reduce time spent on the splash screen, recent changes skip refreshing the online mod list if older version is found in IndexedDB cache. This means the user might have outdated mod list when importing a profile, and the manager can't import mods it doesn't know about. To mitigate the issue, a warning was added to profile preview step with an option for the user to update the mod list. However, the warning uses the mod list in Vuex to check if a mod is available, which is a mistake since that only checks if the mod itself is known, and not whether the mod version in the profile is known. This caused recently updated mods to not always trigger the warning. The download part uses IndexedDB as its source of truth, and silently ignored the unknown mods/versions, since user has explicitly decided to import a partial profile. To fix the issue, both parts now use IndexedDB as the source of truth. The implementation now somewhat akwardly handles the mod information as ExportMods (read from mods.yml and required to know which mods are disabled), ThunderstoreMods (required to use existing UI components), and ThunderstoreCombos (required to download a specific version of the mod). This could potentially be simplified but is outside the scope of this PR. --- .../profiles-modals/ImportProfileModal.vue | 59 +++++++++---------- src/model/ThunderstoreCombo.ts | 3 + src/store/modules/TsModsModule.ts | 5 +- src/utils/ProfileUtils.ts | 26 ++++---- 4 files changed, 48 insertions(+), 45 deletions(-) diff --git a/src/components/profiles-modals/ImportProfileModal.vue b/src/components/profiles-modals/ImportProfileModal.vue index 70ef23421..c855dd5c7 100644 --- a/src/components/profiles-modals/ImportProfileModal.vue +++ b/src/components/profiles-modals/ImportProfileModal.vue @@ -1,11 +1,12 @@