From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
Dominik Csapak <d.csapak@proxmox.com>
Subject: [pve-devel] applied: [PATCH manager] ui: migrate: fix disabled migrate button glitch
Date: Thu, 22 Jun 2023 14:53:30 +0200 [thread overview]
Message-ID: <15135a9b-3b3a-6fcb-950a-018e4cb31a64@proxmox.com> (raw)
In-Reply-To: <20230622121512.1283861-1-d.csapak@proxmox.com>
Am 22/06/2023 um 14:15 schrieb Dominik Csapak:
> under certain circumstances, the migrate button stays disabled, even
> when a valid target node was selected:
> * the first node that gets autoselected (most likely the second)
> is not a valid migration target
> * the user changes to a migration target that is a valid one
>
> if that happens, the migration button would stay disabled.
> switching once to a non valid target and would enable the button.
>
> To fix it, we have to do two things here:
>
> 'checkQemuPreconditions' is actually an async function that awaits an
> api call and uses the result to set the 'migration.allowedNodes'
> property
>
> 'checkMigratePreconditions' calls 'checkQemuPreconditions' and uses the
> 'migration.allowedNodes' property afterwards.
>
> but since 'checkMigratePreconditions' is not async, that happens before
> the api call can return the valid data and thus leaves it empty, making
> all nodes valid in the selector. (thus the initial selected node is
> valid)
>
> instead make 'checkMigratePreconditions' also async and await the result
> of 'checkQemuPreconditions'
>
> this unearthed another issue, namely we access an object that is
> possibly undefined (worked out before due to race conditions) so
> fallback to an empty object.
>
> and lastly, since we want the 'disallowedNodes' set before actually
> checking the qemu preconditions, we move the setting of that on
> the node selector above the qemu preconditions check
> (this is the only place where we set it anyway, and the source does not
> change, we probably could move that out of that function altogether)
>
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
> www/manager6/window/Migrate.js | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
>
applied, thanks!
prev parent reply other threads:[~2023-06-22 12:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-22 12:15 [pve-devel] " Dominik Csapak
2023-06-22 12:53 ` Thomas Lamprecht [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=15135a9b-3b3a-6fcb-950a-018e4cb31a64@proxmox.com \
--to=t.lamprecht@proxmox.com \
--cc=d.csapak@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox