Does Package Serialization Persist Across an Update?


I’m working on a package called night-light that automatically switched the user’s configured themes based on the time of day. User’s are able to configure their daytime and nighttime themes in the package settings.

When updating the package to the most recent version, I noticed that the user’s settings did not persist across the update, and all of the package settings reset to their default values. To solve this, I am implementing serialization within my package to keep track of the user’s settings.

Will the data that’s serialized by the package prior to the update persist to the new session?

In other words, is the serialize method called when updating a package, and is that serialized object passed back to the activate method after the update? Or do package updates not follow the normal deactivation lifecycle? Thank you in advance for your help!


Where did you have the settings stored previously? Were they in config.cson?


@DamnedScholar Yes. I just relied on the default behavior for package-specific settings.


Can you replicate the deletion of config.cson entries across package updates? Because that’s irregular, and if you’re not doing something funky, the devs would probably like to know that there’s a risk of package settings getting lost.


@DamnedScholar Thanks for the help! I’ll search around to see if it’s possible to simulate the update process so I can reproduce this issue. Otherwise, I hope to publish an update by the end of this week so I can look for any unexpected behavior with the config.cson file.