Electron provides sync and async dialog API (file pickers and message boxes). Today we mainly use the sync variant of the API which means that the JavaScript thread is stopped while the dialog is showing. However, for the usages of the dialogs with checkbox, we must use the async version because otherwise the result of the checkbox is not returned.
We should consider switching to the async version of the API to have a consistent usage pattern. However, there are bugs and issues that make this hard:
In order to get this right imho we need to:
- make all dialog API promise based
- switch to the async version of all dialogs
- have a central place on the main thread to handle the case of multiple dialogs opening at the same time. we must ensure that at any time only 1 dialog is active and make sure that other dialog open requests are buffered and processed one after the other
Improves: #17552
Fixes: #9262
Fixes: #39729
Electron provides sync and async dialog API (file pickers and message boxes). Today we mainly use the sync variant of the API which means that the JavaScript thread is stopped while the dialog is showing. However, for the usages of the dialogs with checkbox, we must use the async version because otherwise the result of the checkbox is not returned.
We should consider switching to the async version of the API to have a consistent usage pattern. However, there are bugs and issues that make this hard:
In order to get this right imho we need to:
Improves: #17552
Fixes: #9262
Fixes: #39729