Skip to content

Loading…

Backing up settings isn't working under certain circumstance #307

Closed
Mikey1993 opened this Issue · 15 comments

2 participants

@Mikey1993

When backing up uBlock to file from the About tab, there are no "Dynamic filtering" rules, e.g. default/custom domain script/frame settings.

@gorhill

Works from here. Can you give me the exact steps to repro what you see?

@Mikey1993

Hmmm..that's strange..
The issue I am having is not with the restore of Dynamic filtering feature, but with the restoring process itself it seems..

If I pack manually the extension from Github, and install it along with the "original" release that I already had before, and then try to restore the settings from the backup file that was created with the "original" extension to the newly packed extension (When the "original" extension is disabled, and the packed one is enabled of course), there is no error/reload of the extension when restoring the backup file, e.g., some uncaught error seems to happen..
BUT
If I first delete the "original" extension, and then try to backup from the same "original" created backup file, it works like charm.

It's not very typical for people to do like I did (I did it purely for testing purposes), and it's an end usage behavior, but it's still an issue of itself.

@Mikey1993 Mikey1993 changed the title from Dynamic filtering: settings aren't backed up to Backing up settings isn't working under certain circumstance
@gorhill

install it along with the "original"

Do you mean "load unpacked extension..." from the extension page?

@Mikey1993

No, I packed the extension beforehand.
And then installed it by draging & dropping the crx file to the extensions list.

@gorhill

I packed the extension beforehand

I just tried this, and it all went well, all was restored properly.

@gorhill

There is an assumption I made in the code when restoring, which is that if I force a restart of the extension, all what has been written to the local storage will be properly flushed to physical storage before exiting the extension. I am wondering if this is the case.

@Mikey1993

"...I just tried this, and it all went well, all was restored properly."

Did you deleted the "original" extension when the newly packed extension was already installed or before that?

If before, do it AFTER you have installed the packed extension:
1) Try to restore the backed up file to the packed extension - Fail.
2) Delete the original extension.
3) Try again restoring the backed up file to the packed extension - Success.

@gorhill

I didn't delete the original.

@Mikey1993

It worked for you when both the original and the packed extension were installed?
Original extension was in disabled mode when you have tried to restore the backed up file in the packed extension?

@gorhill

Almost yes to both. I use my own local version, not the one from the store. I will install from store and see what happens.

@gorhill

Worked fine as well.

The extension id of the store version is cjpalhdlnbpafiamejdnhcphjbkeiagm. The extension id of the one I manually packed is pafnjpemcoalhmcdfgjaoboeadhefbma (I suspect this last one will be different every time it is "dropped").

So long as the extension ids are different, their storage should not interfere at all.

@gorhill

If you can reproduce systematically, I have a patch which I want you to try. I will commit the changes if you confirm you reproduce all the time.

@Mikey1993

Erm.. I was able to reproduce it once more, but somehow can't now.
I need to check what is that thing that makes it unrestorable :(

@Mikey1993

Well, it's just not consistent..
I am doing the same steps every time, but the problem occurs one time, but when I repeat the same process, the settings are restored as should..

Maybe it's because of the auto-update mechanism that is blocking the restoring process?
I am trying to restore the settings everytime some seconds after installation of the packed extension...

@gorhill

Auto-update occurs minutes after the install, and anyways, it tries to auto update only filter lists, settings are left untouched.

The symptoms are consistent with the data not being flushed to physical storage before extension is restarted, the result depends a lot on environment: physical storage speed, CPU, idleness, etc.

@gorhill gorhill added a commit that closed this issue
@gorhill gorhill see if this fixes #307 0c3ec0f
@gorhill gorhill closed this in 0c3ec0f
@gorhill gorhill added a commit that referenced this issue
@gorhill gorhill these also suffered from issue #307 dbd36b2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.