Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade lost settings, import caused breakage afterwards #598

Open
pjeby opened this issue Feb 14, 2024 · 19 comments
Open

Upgrade lost settings, import caused breakage afterwards #598

pjeby opened this issue Feb 14, 2024 · 19 comments

Comments

@pjeby
Copy link

pjeby commented Feb 14, 2024

Earlier this evening I saw a message on one of my computers about how Shortkeys is now running in the background and at system start. So I went to use one of its function keys to make sure everything was still working, and it didn't work. So I went to options and found my configuration empty - the upgrade deleted the configuration, it seems!

I went to a different computer -- same thing. Went to a laptop, pulled the network cable and woke it from sleep so I could export the settings from that machine before that copy's settings could be deleted, too.

I then imported the settings back onto other computers, but couldn't get anything to work. After a while, I noticed that there was an empty shortcut present above the imported items. After deleting the empty item and saving, I got things working again, at least on my main machine. (Haven't tested the others yet.)

tl;dr: Apparently, importing when you don't have any shortcuts (due to the upgrade deleting them) results in a blank shortcut above the imported shortcuts, which then appears to keep the rest from working correctly.

@kouki-itou
Copy link

Same here.
and I noticed CSP error happened.

@nerdgirl
Copy link

Same here. Thankfully I had exported my settings the other day so at least I have the config. But nothing is working even after reimporting them.

@crittermike
Copy link
Owner

crittermike commented Feb 14, 2024 via email

@crittermike
Copy link
Owner

crittermike commented Feb 14, 2024

I just submitted a revert back to 4.0.2 but I have to wait for the webstore to review/publish it. All of your settings should still be there once that is published, as long as you didn't click submit on the settings form.

In the meantime, I'll investigate the issue.

(cc @fastndead in case you have any idea what could have caused this)

@fastndead
Copy link
Contributor

Very sorry so hear the about the issues with the manifest v3 update :(

@crittermike i see the issue is that with manifest v3 we changed configs storage for the keys from local storage to the chrome.storage.local API, and haven't implemented a smooth migration between them. I will have to think about how to do that without having users manually reimport their configs.

the issue with imports is a strange one, i will have to look into it.

thanks @crittermike for reverting back to 4.0.2

@w4tchdoge
Copy link

[...] we changed configs storage for the keys from local storage [...]

Thank you so much for pointing this out, I was able to go check the local storage using DevTools and recover my configuration. Saves me the hassle of re-writing all the JavaScript (which I had also not saved anywhere) for the shortkeys I had which were just running those in the browser console.

@crittermike
Copy link
Owner

No worries @fastndead! You're a champ - this is on me for somehow missing it in my regression testing.

@malkomalko
Copy link

malkomalko commented Feb 14, 2024

Just wanted to add that if you go to the extensions options page and open up dev tools you can get your old data by running copy(JSON.stringify(JSON.parse(localStorage.shortkeys).keys, null, 2)) which will copy the config to your clipboard. Then you should be able to paste this into import to get back up.

@oniatsu
Copy link
Contributor

oniatsu commented Feb 15, 2024

I note here because I saw a way to port the previous localStorage to read chrome.storage.
chrome.storage  |  API  |  Chrome for Developers

@webaschtl
Copy link

Today my javascripts of Shortkey are also lost. After importing them again (yes, I have a backup ;-)), they do not work. And I get this message:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'toLowerCase') at Object.activateKey (content.js:1:6082) at content.js:1:6484 at Array.forEach (<anonymous>) at content.js:1:6469

Has this something to do with this "bug"?

@pjeby
Copy link
Author

pjeby commented Feb 16, 2024

Check if you have a blank entry in your list of shortcuts, and if so, delete it. I don't know if that's the problem you're having, as I never checked the console, but if there's a blank shortcut in the list then none of them will work. And if you imported after the upgrade and never deleted the blank shortcut created by the upgrade, then you probably need to delete it.

@hababr
Copy link

hababr commented Feb 16, 2024

Just wanted to add that if you go to the extensions options page and open up dev tools you can get your old data by running copy(JSON.stringify(JSON.parse(localStorage.shortkeys).keys, null, 2)) which will copy the config to your clipboard. Then you should be able to paste this into import to get back up.

Thank you @malkomalko, I was able to import the copied shortcuts.

@crittermike
Copy link
Owner

Hi all, quick update, the reverted package keeps getting rejected by the webstore team for annoying reasons. I just submitted the 3rd attempt - hopefully that one goes through.

@webaschtl
Copy link

Check if you have a blank entry in your list of shortcuts, and if so, delete it. I don't know if that's the problem you're having, as I never checked the console, but if there's a blank shortcut in the list then none of them will work. And if you imported after the upgrade and never deleted the blank shortcut created by the upgrade, then you probably need to delete it.

Hm, I still do not know the cause. There was no blank entry.
On my second PC the shortcuts had also gone. But with the tip in this thread (#598 (comment)) to restore the "old" data, the Shortkeys now working again.

@dannypernik
Copy link

Just wanted to add that if you go to the extensions options page and open up dev tools you can get your old data by running copy(JSON.stringify(JSON.parse(localStorage.shortkeys).keys, null, 2)) which will copy the config to your clipboard. Then you should be able to paste this into import to get back up.

Forgive my naivety, but where do I run this? I tried the developer console but got a syntax error.

@crittermike any update from the webstore?

@hababr
Copy link

hababr commented Feb 21, 2024

@dannypernik Dev console from options page.

@crittermike
Copy link
Owner

@dannypernik the revert should be posted now - 4.1.2. I've heard from others that that fixed things for them. No luck from your end?

@dannypernik
Copy link

@crittermike I confirmed that version 4.1.2 is active, but former shortcuts are not displaying. They weren't the most sophisticated or numerous shortcuts (yet) so I'm fine to recreate them if necessary.

@hababr here's what I'm seeing:
image

@dannypernik
Copy link

@crittermike following up here. I added a few of my shortcuts back to my blank options but never got my old ones back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests