[pbs-devel] [PATCH proxmox-backup 1/2] gui: remove document.execCommand calls

Gabriel Goller g.goller at proxmox.com
Thu Mar 14 10:08:07 CET 2024


On Thu Mar 14, 2024 at 8:59 AM CET, Dominik Csapak wrote:
> hi,
>
> just to note: changing to an async function can be rather dangerous,
> sometimes extjs not only calls the handlers/events/etc. but does things
> after them (expecting the function to be finished) or waits for the return value.

Hmm, but does it actually **await** the return value? I'm not a ext.js
expert but I don't think it is. Anyways it's fine because js promises
are executed eagerly + promise returned directly.

> (most of the extjs code was from before async/await was a thing in js)
>
> so here it seems to work out fine, but we have to be careful with
> sprinkling async function in the code, otherwise we'll get
> very unexpected results
>
> in general, i'd like to see that mentioned in the commit message
> why it's ok to do that (no hard feelings though)
>
> otherwise LGTM

What do you think about adding this to the commit message:

    Making the handler functions async is not a problem, because
    promises in js are executed eagerly (not lazily) and nothing
    depends/waits on the result of this handler.




More information about the pbs-devel mailing list