restore: when restoring apps, use the latest backup id

this ignores the user provided site information. the site contents may or may
not contain this app.
This commit is contained in:
Girish Ramakrishnan
2025-11-25 18:12:52 +01:00
parent cc1fc5c269
commit bbdfbe1ab7

View File

@@ -2864,7 +2864,8 @@ async function restoreApps(apps, options, auditSource) {
let installationState, restoreConfig;
if (!error && result.length) {
installationState = exports.ISTATE_PENDING_RESTORE;
restoreConfig = { remotePath: result[0].remotePath, backupSite: options.backupSite };
// intentionally ignore options.backupSite since the site may not have all the apps
restoreConfig = { backupId: result.id };
} else {
installationState = exports.ISTATE_PENDING_INSTALL;
restoreConfig = null;