From 56be1bf4a9ccb7edf56c1026f3da7a33006866c7 Mon Sep 17 00:00:00 2001 From: Julien Fontanet Date: Thu, 7 Sep 2023 16:55:29 +0200 Subject: [PATCH] fix(xo-server/importVmBackupNg): set result when restoring via XO Proxy --- CHANGELOG.unreleased.md | 4 ++++ packages/xo-server/src/_handleBackupLog.mjs | 2 +- packages/xo-server/src/xo-mixins/backups-ng/index.mjs | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index 77ab5de5ab2..2c47eb7b1e9 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -11,6 +11,8 @@ > Users must be able to say: “I had this issue, happy to know it's fixed” +- [Backup/Restore] Fix `Cannot read properties of undefined (reading 'id')` error when restoring via an XO Proxy (PR [#7026](https://github.com/vatesfr/xen-orchestra/pull/7026)) + ### Packages to release > When modifying a package, add it here with its release type. @@ -27,4 +29,6 @@ +- xo-server patch + diff --git a/packages/xo-server/src/_handleBackupLog.mjs b/packages/xo-server/src/_handleBackupLog.mjs index 52d9da4f775..05fa21f25b5 100644 --- a/packages/xo-server/src/_handleBackupLog.mjs +++ b/packages/xo-server/src/_handleBackupLog.mjs @@ -41,7 +41,7 @@ function forwardResult(log) { // it records logs generated by `@xen-orchestra/backups/Task#run` export const handleBackupLog = ( log, - { vmBackupInfo, app, jobName, logger, localTaskIds, rootTaskId, runJobId = rootTaskId, handleRootTaskId } + { vmBackupInfo, app, jobName, logger, localTaskIds, rootTaskId, runJobId, handleRootTaskId } ) => { const { event, message, parentId, taskId } = log diff --git a/packages/xo-server/src/xo-mixins/backups-ng/index.mjs b/packages/xo-server/src/xo-mixins/backups-ng/index.mjs index 25f30ba0a3b..67b4325d62b 100644 --- a/packages/xo-server/src/xo-mixins/backups-ng/index.mjs +++ b/packages/xo-server/src/xo-mixins/backups-ng/index.mjs @@ -496,6 +496,7 @@ export default class BackupNg { this._runningRestores.add(id) rootTaskId = id }, + rootTaskId, }) } } catch (error) {