weixin_39849942
2021-01-12 18:31 阅读 0

BridgeConnector Reconnected causes loss of socket

I'm still encountering this bug with the result that my frontend doesnt react on events anymore after a reconnect.

My hypothesis is that this happens whenever there is a large cpu or ram load going on. Due to this the app-lifetime can vary from 1 minute to multiple days depending on what I'm doing with my pc. The result however is that the user will have to manually end the app-task through the task manager since closing the app otherwise will leave the user with around 5 processes that dont close. (the app is unstartable due to that)

Like I said, it happens pretty randomly but my guess is resource loads due to other programs. There is one way to trigger this bug consistently though: - I make sure I log all events I send from my core to the frontend. (any other stream of logs will also work) - I make the app 'hang' by selecting a log forcing the program in an 'awaiting' state - I wait around 2 minutes - Then I unselect the console-logs to make the app continue - There is a high-chance (if you wait long enough; always) that the Bridge Reconnected message shows up. - After this the app is left in a state where the frontend javascript calls still work, however the app doesnt update anymore.

In this broken state I can still manually refresh the page to make the app show the latest data, however events through listeners dont work anymore. For some extra context I attached an url to a youtube video replicating this, I can provide you with some extra details or logs if you want.

My current environment: * Windows 10 * Version: ElectronNET API & CLI 8.31.1.0 * Target: .NET Core 3.1 + NodeJS v12.16.2

Let me know if you have any ideas/details, Greeting, Thom

ElectronNET Bridge Connector bug

该提问来源于开源项目:ElectronNET/Electron.NET

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

10条回答 默认 最新

  • weixin_39815031 weixin_39815031 2021-01-12 18:31

    I have the same issue, did you fixed this?

    点赞 评论 复制链接分享
  • weixin_39870413 weixin_39870413 2021-01-12 18:31

    Honestly, I have no idea why the problem can be. Normally everything is still supported with a reconnect. Socket.IO and .NET Core with the library we used (SocketIoClientDotNet) are unfortunately no longer being developed and we would have to find an alternative. is currently working on a prototype of how we could do completely without websockets. However, this will be hard work because we have to rewrite our whole core.

    However, I would have an idea for a workaround. You would have to try this out for yourself. If the connection is lost, you can completely reload the app. You would have to tap this via HostHook. See the Electron.NET API demo app under "Execute your own TypeScript code". In an emergency, I can show you the possible code. But would take time for me now. That might not be prioritized according to the prototype for me.

    https://github.com/ElectronNET/electron.net-api-demos

    点赞 评论 复制链接分享
  • weixin_39815031 weixin_39815031 2021-01-12 18:31

    , this issue that makes bridgeconnector reconnected only happends in Electron.Net version 8.31 +?, or this happens in all version of Electron.Net cuz i'm working on a project using this tool but i always lose connectivity and after that i cant do any operation... so if i go back to an old version it will be fixed?? I see my electronize build /win failed when i start the exe, this loses brigeconnector too.

    点赞 评论 复制链接分享
  • weixin_39934085 weixin_39934085 2021-01-12 18:31

    Every now and then I get the same problems. You can also reproduce it, if you check for updates in debugger (not deployed / packed).

    But just for fun I updated to the newest version of socket.io and everything work like a charm! I noticed that ElectronNET.Host has a mismatch in the version number: package.json has 2.1.2 but package-lock.json has 2.1.4 maybe that causes the problems?

    Update Or maybe not...

    点赞 评论 复制链接分享
  • weixin_39870413 weixin_39870413 2021-01-12 18:31

    If the latest Socket.IO version works without problems.. Then we can update it.. best try with the demo app if everything still works..

    点赞 评论 复制链接分享
  • weixin_39815031 weixin_39815031 2021-01-12 18:31

    I only have one question about it, i updated to versions 8.31.2+, When i run ElectronNet project, menu is not working, i try to click Edit, View, Window, Help and it is not showing the dropdown, or popup. I had to clean something or it is a bug??

    点赞 评论 复制链接分享
  • weixin_39870413 weixin_39870413 2021-01-12 18:31

    please see #401

    点赞 评论 复制链接分享
  • weixin_39870413 weixin_39870413 2021-01-12 18:31

    Updatet to socket.io 2.3.0 - publish with Electron.NET 9.31.1

    if the problem persists, we can open the issue again

    点赞 评论 复制链接分享
  • weixin_39934085 weixin_39934085 2021-01-12 18:31

    I have run several tests and this time no connection was closed! So it seems stable to me.

    点赞 评论 复制链接分享
  • weixin_39849942 weixin_39849942 2021-01-12 18:31

    Hey, Are there any particular files I need to setup or change to publish with socket.io 2.3.0 and ElectronNET 9.31.1?

    点赞 评论 复制链接分享

相关推荐