spdermn02 / TouchPortal_Discord_Plugin

Touch Portal Plugin to Interact with Discord
GNU General Public License v3.0
60 stars 24 forks source link

When discord is closed, plugin throws error. #78

Open DeimosJ opened 8 months ago

DeimosJ commented 8 months ago

Whenever discord is closed, such as for an update or manual restart, the plugin throws a connection closed error and stops running. This issue can only then be fixed by manually restarting the plugin.

discord closed.log

I've tested this with the latest release (v4.3.1) and the pre-release (v4.4.0-Alpha-1) and get the same results (log is from 4.4.0)

spdermn02 commented 8 months ago

I'll take a look when I can. With process watcher disabled it will kill the plugin (I think) if discord disconnects. Need to probably use a better detection process and error handler.

Really would love to rewrite some of this but, unfortunately don't have the time.

But I'll review when I can.

DeimosJ commented 8 months ago

No rush, i setup a global event that triggers a restart of the plugin any time it's state to discord becomes "Disconnected" and this kicks the watcher back on, solves the problem in a hacky way for now.

It's probably best to rework the plugin when you get the free time anyway, it's a losing battle to be always patching up the leaks and this one isn't urgent. Thanks for the quick reply to this issue and all your hard work on this plugin 👍

DeimosJ commented 3 months ago

To add to this, i often get Connection reset by peer errors when the plugin has been running for a day or so and once it drops the only way to fix it is to restart the plugin. Because this is a Touch Portal <-> Plugin error my previous work around does not fix this as Touch Portal still thinks everything is fine.