gorhill / httpswitchboard

Point & click to forbid/allow any class of requests made by your browser. Use it to block scripts, iframes, ads, facebook, etc.
GNU General Public License v3.0
1.33k stars 83 forks source link

Own block rules lost after update to v. 1.0.0.3 #381

Closed ghost closed 9 years ago

ghost commented 9 years ago

Unfortunately, the "Your block rules" window is empty now. I assume that this problem might be related to the FileSystem API change?

gorhill commented 9 years ago

Crap.

I just reviewed the code and I can't see why it wouldn't work. Will keep looking but it's kind of too late at this point, there is no way back.

If you have a back up, restoring should work fine though.

ghost commented 9 years ago

Yes, I was able to restore them.

BTW, I forgot to mention that I also have some allow rules in ABP syntax which I forgot to remove in HTTPSB - they "survived".

gorhill commented 9 years ago

Ok so if I understand, before the restore, the block rules were gone, while the allow rules were properly converted to the new storage?

ghost commented 9 years ago

Ok so if I understand, before the restore, the block rules were gone, while the allow rules were properly converted to the new storage?

Exactly!

gorhill commented 9 years ago

Ok. I see potential for a race condition, where there is an attempt to load data before it has been saved. If so, this means that your data was properly converted, but somehow the actual writing of bytes to the storage did not occur before the data was requested.

I need to fix this.

The workaround meanwhile in case other users end up with the same problem is a simple restart of the extension (disabling/enabling).

ghost commented 9 years ago

The workaround meanwhile in case other users end up with the same problem is a simple restart of the extension (disabling/enabling).

I didn't think of this workaround. Too late to test it now ...

gorhill commented 9 years ago

Actually, correction:

The data was irremediably lost. Whichever "block" or "allow" rules was saved first was clobbered if both fields had rules.

I can still save Opera users I think.