You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the problem
I have an app where the App.save() function only saves config parameters that are modified from their default.
This allows for people to get the updated value if the default changes, without manually setting the new default or manually clearing the storage.
I have added functionality to reset all the config parameters to their default value, causing the App.save() method to no longer set their values.
Despite this, the keys and values persist in the app.ron after closing the app and get loaded again when relaunching.
Older parameters that I no longer save or load are also persist in the app.ron, which takes up extra storage space.
The documentation mentions no way to clear the storage or reset a specific key.
Describe the solution you'd like
One way to fix this would be to only save keys set by the most recent call to App.save(). This would automatically clean up removed parameters and easily allow for clearing the storage by just not saving any keys.
The downside of this solution is that it is not backwards compatible with some apps e.g. ones that only set their configuration when it has changed since the last save. This could be addressed by using a feature to toggle between the current functionality and the new functionality.
Another way to fix this would be to add a function to clear all the keys in the storage, and/or a function to clear a specific key. This still has the problem of leaving older parameters around unless completely clearing the storage, but preserves backwards compatibility with existing apps.
Describe alternatives you've considered
One alternative would be using a specific string to mark a default value, however this adds complexity to parsing, takes up more storage space, and still leaves obsolete parameters stored.
The text was updated successfully, but these errors were encountered:
Describe the problem
I have an app where the
App.save()
function only saves config parameters that are modified from their default.This allows for people to get the updated value if the default changes, without manually setting the new default or manually clearing the storage.
I have added functionality to reset all the config parameters to their default value, causing the
App.save()
method to no longer set their values.Despite this, the keys and values persist in the
app.ron
after closing the app and get loaded again when relaunching.Older parameters that I no longer save or load are also persist in the
app.ron
, which takes up extra storage space.The documentation mentions no way to clear the storage or reset a specific key.
Describe the solution you'd like
One way to fix this would be to only save keys set by the most recent call to
App.save()
. This would automatically clean up removed parameters and easily allow for clearing the storage by just not saving any keys.The downside of this solution is that it is not backwards compatible with some apps e.g. ones that only set their configuration when it has changed since the last save. This could be addressed by using a feature to toggle between the current functionality and the new functionality.
Another way to fix this would be to add a function to clear all the keys in the storage, and/or a function to clear a specific key. This still has the problem of leaving older parameters around unless completely clearing the storage, but preserves backwards compatibility with existing apps.
Describe alternatives you've considered
One alternative would be using a specific string to mark a default value, however this adds complexity to parsing, takes up more storage space, and still leaves obsolete parameters stored.
The text was updated successfully, but these errors were encountered: