Summary
It would be helpful if IP auto-reveal mode could be remembered between different sites, for cases where a user is patrolling across different wikis.
Technical notes
The initial implementation of IP auto-reveal works locally, meaning that a user would need to enable it again at each site they are patrolling. This is because it uses localStorage, which is partitioned per origin. Some useful consequences of doing this:
- localStorage is read and updated client-side, meaning that the auto-reveal state can be written and read without interaction with the backend.
- MediaWiki's localStorage wrapper, SafeStorage, has a built in expiry.
Since we need this to work globally, we need a different mechanism. GlobalPreferences is a good mechanism for this, since:
- it provides APIs for getting and setting the value
- as with preferences, when set to false the database row will be removed
- it is stable across different domains
Proposal:
- Store the expiry time as a global preference
- When checking the status, check if it has expired. If so, clear it.
- Since there's no expiry mechanism, possibly add a maintenance script to remove rows containing expired values. The benefit may not be worth the cost here though, since only a limited number of users should use this preference.
Acceptance criteria
- The auto-reveal status is remembered across wikis where the user is able to auto-reveal IPs