httpswitchboard icon indicating copy to clipboard operation
httpswitchboard copied to clipboard

Saved changes become unsaved when switching scopes

Open pointyointment opened this issue 11 years ago • 1 comments

If I go to a website such as www.example.com, HTTPSB offers me three scopes in the scope menu: *, *.example.com, and www.example.com.

If I make changes to the matrix and then click the padlock button in any of these scopes, switch to a different scope, click the padlock button there, and then switch back, the padlock button is again clickable and has the same number of unsaved changes on it as it did before. Also, the saved state indicators on the domains in the left column of the matrix go back to how they were before I clicked the padlock for that scope, and clicking the padlock again again updates them to reflect their current (apparently temporary though saved before) state.

Also, when I switch scopes, the saved state indicator on the scope menu retains the color of the previous scope and then switches to that of the currently chosen scope when I click the padlock. This suggests to me that this might be intentional and I'm just not understanding how a feature is supposed to work. Though, if that's the case, I still don't understand why the saved changes would become unsaved.

Also, sometimes the padlock button seems to save only some of the changes, and remains clickable and with a (smaller) number after I click it. Then I have to click it again to save the rest of the changes.

pointyointment avatar May 21 '14 06:05 pointyointment

Say you land for the first time on www.example.com.

Scopes on disk: *

The default scope will be the global scope, *. Now you want to create a narrower domain scope for that site, so you select *.example.com. You create rules then you save. Now you have scope *.example.com, padlocked, which will be used whenever you land on a web page on example.com.

Scopes on disk: *, *.example.com

Now you change your mind, and you want an even narrower scope and select www.example.com, create rules, then padlock your changes.

Scopes on disk: *, *.example.com, www.example.com

Now you change your mind again, and want to go back to a broader domain-level scope, so you select again *.example.com, then padlock.

Scopes on disk: *. *.example.com

The narrower scope www.example.com had to be destroyed, in order for it to not be looked up when you land on www.example.com, since the matrix filtering engine will always look up and use the narrowest existing scope for a give web page. (I emphasize this part because this is the rule which explains why the scope cell behaves as it does).

Now to be nice to users, when a scope is destroyed, I keep it around in memory for convenience, so that it can be brought back instead of creating a new one from scratch, so that all the rules are still in there. Also, keep in mind that when a scope is not locked down, no rules in it can be seen as locked down, as this makes no sense, hence when a scope is temporary, all the rules in it are deemed temporary.

The top-left indicator reflect which scope would be in effect if you were to clear all temporary changes.

Re. "sometimes the padlock button seems to save only some of the changes", I am pretty sure I've seen that in the past, this should be filed as a separate issue.

gorhill avatar May 21 '14 12:05 gorhill