thedevs-network/kutt-extension

provide seamless migration for existing users to upcoming major version

abhijithvijayan opened this issue · 2 comments

  • Set up a function to update extension settings (from browser local storage)
    to the new settings keys
    Map the keys like autoCopy : true to the new
"settings": {
   "autocopy": true,
   ...
}

on the installation / initialization of new major version.

  • Remove this feature after all the users have switched to the new major version

Without this mapping, the extension will UX issues for those who are using it currently.

Current fields in local storage of almost all users

{
	"URL_array": [],
	"host": "https://google.com",
	"key": "this is the api key",
	"pwd": "password",
	"userOptions": {
		"autoCopy": true,
		"devMode": true,
		"keepHistory": true,
		"pwdForUrls": true
	}
}

Migrate to

{
	"settings": {
		"advanced": true,
		"apikey": "he;;obaby",
		"customhost": "https://google.com",
		"history": false
	}
}

Migration actions are performed once on popup open(once extension is updated to v4.x.x) if previous keys exist on browser local storage.

The code can be removed once all the users receive the update.
I have tested with basic options enabled as well as advanced options(like custom host) enabled. It works. :)

I will leave this issue open if someone runs into issue on migration.