Existing settings erased after plugin update

Answered

Hi there,

I've deployed an update of my existing plugin, which contains an addition of a new setting available for my users. This is simply a new option than can be enabled or not.   

After applying the update in Intellij, I realized that the current configuration of the plugin has been reset. 

Is it a standard behavior in Intellij ? Is there a way to avoid that and keep user's current settings ?

I use this kind of class :

---- 


@State(
name = "com.mycompany.appli.settings.AppSettingsState",
storages = {@Storage("MyCompanySettingsPlugin.xml")}
)
public class AppSettingsState implements PersistentStateComponent<AppSettingsState> {
...
public static AppSettingsState getInstance() {
return ServiceManager.getService(AppSettingsState.class);
}

@Override
public @Nullable AppSettingsState getState() {
return this;
}

@Override
public void loadState(@NotNull AppSettingsState state) {
XmlSerializerUtil.copyBean(state, this);
}
}

----

Thanks to you, all the best.

0
4 comments

Thanks Yann for your answer. 

I'm not sure if it's related, since in my situation there's no IDE upgrade, just plugin upgrade. but maybe it's related :)

 
0

Ok. Please see these possibly related issues:

https://youtrack.jetbrains.com/issue/IDEA-238063

https://youtrack.jetbrains.com/issue/IDEA-196003

If related, please provide your exact configuration and log files (or create new issue in IDEA project). Thanks.

0

Please sign in to leave a comment.