bug: default settings don't update on updates
Type
Error while running the manager
Bug description
If a default setting, like the default API URL changes in an update, installing the new update doesn't update it
Steps to reproduce
- Install ReVanced Manager v1.6.1 (clean install)
- Check the API URL, it should be
releases.revanced.app - Update to ReVanced Manager v1.9.4 from https://revanced.app/download (in-app updates are broken due to
releases.revanced.appnot functioning) - Check the API URL, it should be
api.revanced.appbut instead it'sreleases.revanced.app
Acknowledgments
- [X] I have searched the existing issues; this is new and no duplicate or related to another open issue.
- [X] I have written a short but informative title.
- [X] I properly filled out all of the requested information in this issue.
- [X] The issue is solely related to ReVanced Manager and not caused by patches.
If we decide what the API should be, then why are we even allowing the users to modify it? If we remove the ability to modify it, then we can control it via updates.
then why are we even allowing the users to modify it?
Because the entirety of ReVanced is built in a way that is independent of us, a few extra settings go a long way
OK. So, updating the settings only if they are set to default, right?
Yes
Essentially, the API URL should be a global variable in the app, and the default value of the API URL should use that variable instead of duplicate it, if API URL is equal to the variable after transformation, it should stay a reference to the variable when applying changes
A migration function has been introduced. Does this suffice?
🍜 This issue should been resolved by the release of v1.19.0