I have following setup in my plugin - there are 3 configurations (PersistentStateComponent with Kotlin data classes as state):
- application level - annotated with @State(name = "GitToolBoxAppSettings2", storages = [Storage("git_toolbox_2.xml")])
- project level 1 - @State(name = "GitToolBoxProjectSettings", storages = [Storage("git_toolbox_prj.xml")])
- project level 2 - @State(name = "GitToolBoxStore", storages = [Storage(StoragePathMacros.WORKSPACE_FILE)])
When I modify the plugin to be dynamic I'm faced with following issue:
- plugin is enabled and config is modified - storage files are created and contain the changes
- plugin is disabled
- plugin is re-enabled - storage files disappear, config is lost
What I noticed is that after plugin is re-enabled PersistentStateComponent.noStateLoaded get's called on application level and project level 1. This does not happen on project level 2 (workspace one).
Issue is not always reproducable for application level but is 100% reproducable on project level 1.
This issue also does not occur when plugin is marked as not dynamic.