[Feature] Re-enable plugins that were automatically disabled by an error
Before Requesting
- I found no existing issue matching my feature request
Describe the feature you'd like!
Let's say I have a working plugin:
/**
* @name Test1
* @description Example plugin
* @version 0
* @author Tester
*/
// { throw "123"; }
module.exports = class Test1 {
start =()=> BdApi.UI.showToast("Hello world");
stop =()=> {}
}Enable the plugin. It should show a toast and not error.
Uncomment { throw "123"; } and save.
The plugin will be loaded and run again, then get disabled because of the error.
Now comment out or remove { throw "123"; } and save.
The update will be acknowledged and the plugin, read from disk, but it will not run because it's still disabled. For that matter, it does not get re-enabled now that the error has been resolved. One must go to the plugins menu and manually re-enable it or run BdApi.Plugins.enable("Test1"). This is very annoying.
In previous versions of BetterDiscord, I would put a similar line in my personal plugins to automatically re-enable them after I accidentally introduce and then fix a syntax error or such:
requestIdleCallback(x => BdApi.Plugins.enable("Test1"));Due to https://github.com/BetterDiscord/BetterDiscord/pull/2180 , this no longer works. I've been told that the alternative is to have a separate plugin watch over my plugins and re-enable them.
I propose that BetterDiscord should re-enable plugins that were set to enabled by the user, but disabled by the loader due to an error.
Anything else?
No response
Source: BetterDiscord/BetterDiscord