We're getting lots of crash reports from users on macOS Big Sur. The crashing line is either

https://github.com/electron/electron/blob/e3c4bbd21fb0ea2a79d8572add78e4b8c07c64a8/shell/browser/ui/message_box_mac.mm#L117

or

https://github.com/electron/electron/blob/e3c4bbd21fb0ea2a79d8572add78e4b8c07c64a8/shell/browser/ui/message_box_mac.mm#L128

The crash report is annotated with:

>Crashing on exception: -[NSApplication runModalForWindow:] may not be invoked inside of transaction begin/commit pair, or inside of transaction commit (usually this means it was invoked inside of a view's -drawRect: method.)
>ViewBridge hint(s): (
>     "bridge key: most-recent-completion"
>)

This is on Electron 10.1.6, I have not tested other versions.

cc @zcbenz
shell/common/gin_helper/promise.h
public:
  using PromiseBase::PromiseBase;
  
  static void ResolvePromise(Promise<void> promise);
  
  static v8::Local<v8::Promise> ResolvedPromise(v8::Isolate* isolate);
  v8::Maybe<bool> Resolve();
};
}  
namespace gin {
template <typename T>
struct Converter<gin_helper::Promise<T>> {
  static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
                                   const gin_helper::Promise<T>& val) {
    return val.GetHandle();
  }
  
  
  
  
  
};
}  
#endif