Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing settings from different versions can cause extension to enter an erroneous state #829

Closed
aurtzy opened this issue Oct 13, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@aurtzy
Copy link

aurtzy commented Oct 13, 2023

Hi, I recently encountered a strange issue with some of my popup services not showing up.

This issue seems to be caused by the recent removal of services which resulted in some now-invalid popup service entries in my export file to be improperly imported, and wouldn't be fixed until I manually edited it to remove those invalid entries.

Steps to reproduce:

  1. Export the default settings.
  2. Modify the exported file to include an invalid popup service somewhere in the middle of the "popupServices" list (to make issue obvious; still a problem if it's at the end). This simulates a previously-valid-but-now-invalid service being included as a popup.
  3. Import this modified settings file.
  4. Expect the exported default popup services to still be displayed, but be greeted with only a subset of them shown - more specifically, only the ones above the invalid popup in the list are shown.

In the state produced by these steps, the Show in popup toggle only works for removing popups - trying to enable a popup does nothing. Additionally, the initial invalid list of popups remain the same on exports. Even if a popup is disabled, it will be exported in whatever state it was initially imported in, so having an invalid popup service in the list basically makes it unchangeable without manual editing if one utilizes exports.


I will say, I actually hadn't known about some of these services until LibRedirect added them (surprisingly helpful way to discover these sorts of projects!), and I've found myself utilizing them a fair bit. It's a shame I understand they were probably out of scope for this project.

Cheers, big enjoyer of LibRedirect.

@ManeraKai ManeraKai added the bug Something isn't working label Oct 18, 2023
@ManeraKai
Copy link
Member

ManeraKai commented Oct 21, 2023

I will say, I actually hadn't known about some of these services until LibRedirect added them (surprisingly helpful way to discover these sorts of projects!), and I've found myself utilizing them a fair bit. It's a shame I understand they were probably out of scope for this project.

Some of them will come back, but others like librespeed and myip won't.

There's no mechanism for importing older versions of an exported settings. The conversion of old settings only happens for the internal settings when you update the extension. So if you want things to look right, you should first import the settings in an older version, then update the extension. I made it like this because, the storage structure changes a lot, and we don't have a proper way of converting far apart versions. So we only convert the most previous version, and internally too.

@aurtzy
Copy link
Author

aurtzy commented Oct 21, 2023

The conversion of old settings only happens for the internal settings when you update the extension. So if you want things to look right, you should first import the settings in an older version, then update the extension.

Ah, I see. I often take fairly long periods of time between exporting settings and importing them, so I'm not usually aware of the exported settings version and extension version before I import.

I made it like this because, the storage structure changes a lot, and we don't have a proper way of converting far apart versions. So we only convert the most previous version, and internally too.

Would it be logical to ignore unrecognized entries or use defaults for missing ones? That would at least fix settings becoming (and staying) corrupt, although it wouldn't fix the broader problem of converting restructurized settings. Converting from the previous version for imports in addition to internal conversions might also be something to consider.

Perhaps I'll just have to keep conscious of it and adjust my syncing workflow.

@ManeraKai
Copy link
Member

ManeraKai commented Oct 21, 2023

Using defaults for missing or invalid ones is the more logical solution. Because version conversion will be really complicated. Rename the title of this issue if you can.

@aurtzy aurtzy changed the title Invalid popup service entries are not resolved on imports or exports Importing settings from different versions can cause extension to enter an erroneous state Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants