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 widget-toolkit v2] utils: API2Request: defer masking after layout
Date: Tue, 19 Mar 2024 18:07:31 +0100 [thread overview]
Message-ID: <74e01e98-d781-4f1c-8023-3b7cbbe74dbe@proxmox.com> (raw)
In-Reply-To: <20240319085138.508007-1-d.csapak@proxmox.com>
On 19/03/2024 09:51, Dominik Csapak wrote:
> since recently (not sure when exactly), the 'load()' method of the edit
> window did not correctly mask the window anymore
>
> the reason seems to be that the API2Request tries to mask the component
> before it's rendered, and that did never work correctly.
>
> Instead of simply calling `setLoading`, test if the component is
> rendered, and if not, mask it after it has finished it's layout.
>
> Since we cannot guarantee that there is only one API2Request with the
> waitMsgTarget set to it, nor that the 'afterlayout' and api call
> responses come in a specific order, we count the loads, and only
> ever unmask the component when the counter reaches zero again.
>
> Since we're strictly in non-async code here and javascript is
> single-threaded, this should not result in a data race.
>
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
> changes from v1:
> * use a counter for all loads instead of a unique id to keep the loading
> mask until all loads are finished that were started in the meantime
> * improve commit message to make the data race sentence correct
>
> src/Utils.js | 21 +++++++++++++++++----
> 1 file changed, 17 insertions(+), 4 deletions(-)
>
>
applied, thanks!
prev parent reply other threads:[~2024-03-19 17:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-19 8:51 [pve-devel] " Dominik Csapak
2024-03-19 17:07 ` 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=74e01e98-d781-4f1c-8023-3b7cbbe74dbe@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