Skip to content

Get properties that use Task.Run().Result seem to block execution #431

Closed
@freosc

Description

@freosc
  • Version: latest from github 9.31.1

.net core 3.1 node 12.16.3

  • Target: win

Steps to Reproduce:

  1. 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);
  1. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions