You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the demo Electron.Net WebApp, in ElectronBootstrap, I added these lines of code
Console.WriteLine("set AllowDowngrade");
Electron.AutoUpdater.AllowDowngrade = true;
Console.WriteLine("get AllowDowngrade");
//Code execution blocks on the following line
bool allowDowngrade = Electron.AutoUpdater.AllowDowngrade;
Console.WriteLine("AllowDowngrade: " + allowDowngrade);
The set property works fine, but I noticed that the get property blocks execution, so the console won't show the last line in the code block above.
Inside the property getter code I see that the code is executed correctly, but the socket.on "autoUpdater-allowDowngrade-get-reply" event is never fired.
This bug occurs for all property getters in the electron.net code that use the Task.Run().Result pattern
(Sidenote: a few seconds after the code execution is blocked, the socket also disconnects)
The text was updated successfully, but these errors were encountered:
I discovered that it does work in sync methods, and doesn't work in async methods.
If you put the example lines of code inside the Program.CreateWebHostBuilder, like this:
public static IWebHostBuilder CreateWebHostBuilder(string[] args)
{
var x = WebHost.CreateDefaultBuilder(args)
.ConfigureLogging((hostingContext, logging) => { logging.AddConsole(); })
.UseElectron(args)
.UseStartup<Startup>();
Console.WriteLine("set AllowDowngrade");
Electron.AutoUpdater.AllowDowngrade = true;
Console.WriteLine("get AllowDowngrade");
//Code execution blocks on the following line
bool allowDowngrade = Electron.AutoUpdater.AllowDowngrade;
Console.WriteLine("AllowDowngrade: " + allowDowngrade);
return x;
}
This will work. But it'll fail when ran from an async method such as the async ElectronBootstrap()
in your demo webapp, or in case somewhere upstream in the stacktrace an async method is used.
.net core 3.1 node 12.16.3
Steps to Reproduce:
Inside the property getter code I see that the code is executed correctly, but the socket.on "autoUpdater-allowDowngrade-get-reply" event is never fired.
This bug occurs for all property getters in the electron.net code that use the Task.Run().Result pattern
(Sidenote: a few seconds after the code execution is blocked, the socket also disconnects)
The text was updated successfully, but these errors were encountered: