waifu-motivator/waifu-motivator-plugin

Dynamic Plugin is not triggered on plugin update and losing the project listeners

zaerald opened this issue · 1 comments

Describe the bug

Intellij requires to restart on plugin update and losing project listeners

To Reproduce
Steps to reproduce the behavior:

  1. Prepare 2 different versions of the plugin, you can change the version from build.gradle, change the versions and build it

    version System.getenv().getOrDefault('VERSION', '').replace('refs/tags/v', '')

  2. Open a new intellij instance, it would be better if locally built from the intellij-community source, to have fresh configs, caches, etc.

  3. Install the first plugin and it's properly installed without restarts (drag-and-drop the built plugin to the IJ)

  4. Install the second plugin with a different version

  5. It's now asking for a restart

Expected behavior

Should have the same behavior as plugin install.

Platform:

  • Version WMP v1.4

Additional context
As per discussion: #260 (comment)

Related to:

I am fairly confident this is not an issue anymore, a large majority of the listeners are registered in the plugin.xml https://github.com/Unthrottled/AMII/blob/f9a732eda464021b2a80972f5285c5e13a7cd05c/src/main/resources/META-INF/plugin.xml#L27

So the platform takes care of registering those, and there is a listener for the plugin being installed to register the non-regular listeners.

https://github.com/Unthrottled/AMII/blob/f9a732eda464021b2a80972f5285c5e13a7cd05c/src/main/kotlin/io/unthrottled/amii/listeners/IDEPluginInstallListener.kt#L27
https://github.com/Unthrottled/AMII/blob/f9a732eda464021b2a80972f5285c5e13a7cd05c/src/main/kotlin/io/unthrottled/amii/PluginMaster.kt#L77

It's now asking for a restart

I still haven't figured out the pattern for this either. Sometimes I can take an update without restarting, sometimes I can. It's weird.

Perhaps related to this: https://plugins.jetbrains.com/docs/intellij/dynamic-plugins.html#troubleshooting