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

Stylus stopped enabling / disabling or installing userstyles! (Chrome) #839

Closed
nastajus opened this issue Feb 7, 2020 · 9 comments · Fixed by #840
Closed

Stylus stopped enabling / disabling or installing userstyles! (Chrome) #839

nastajus opened this issue Feb 7, 2020 · 9 comments · Fixed by #840

Comments

@nastajus
Copy link

nastajus commented Feb 7, 2020

  • Browser: Chrome 79.0.3945.130 and 80.0.3987.87 (Official Build) (64-bit)
  • Operating System: Windows 10.0.18362
  • Stylus Version: 1.5.7
  • Screenshot:

image
image
image

Error while downloading usoID:............ Reason: TypeError: Cannot read property 'result' of undefined

Today my long-time install of Stylus stopped working partially. I cannot install new styles, getting errors visibly shown above. Also, I cannot disable or enable individual styles now. The checkbox changes in both the popout and the extensions manager page, but no page updates ever trigger, and if you simply toggle the check and leave the window and return, the previous checkbox state is restored. And when I edit an individual style, toggle enabled checkbox, click save, and try to refresh, Chrome warns me "changes may not be saved", which definitely means they're not. I can delete styles or turn all styles off at once though.

Tried restarting Chrome, nothing. Tried using incognito Chrome with very few plugins, same errors happen (which perhaps always happened?). Haven't tried reinstalling (fear losing a hundred styles hand-picked for high contrast accessibility). Haven't tried rebooting yet (lots of ongoing tasks!). Checked on random popular sites: Google, Wikipedia, LinkedIn, GitHub, all the same result. Never seen this behavior before ... in years?! Suspect an auto-update somewhere broke? Unsure.

Just saw Chrome ask me to relaunch to update to 80.0.3987.87, so I did, saw this:
image
So clearly all those are my individual repeated clicks to install random non-dark theme, a very unusual state! So redundant instances are 'semi-installed' which ... only became visible upon relaunch? Regardless, same issues remain.

I'm invested in seeing this plugin work well. I can check some things on behalf to help diagnose if it's uniquely on my system, if given some direction pointers how to do so.

@narcolepticinsomniac
Copy link
Member

Chrome update has been available for a few days already, so I would guess many, if not most users have received the update. If this issue was widespread, I would think we'd have an endless stream of reports by now. Maybe that's something we have to look forward to though.

This is the first such report here, but we did get a weird email the other day reporting similar issues with disabling styles. That user reported one instance of Stylus updated fine, but the other had issues toggling styles. They reported back that they re-installed Stylus, which fixed the bugs they were experiencing.

Haven't tried reinstalling (fear losing a hundred styles hand-picked for high contrast accessibility).

Export a local backup in the manager first. If you've got a hundred hand-picked styles, you probably wanna be backing them up regularly anyway. There's also a new sync feature in 1.5.7 once you get it up and running.

I can check some things on behalf to help diagnose if it's uniquely on my system

We will definitely need to try to get to the bottom of this, if it becomes clear that it is a widespread issue. Can't really put the toothpaste back in the tube, but we'd need to know what went wrong moving forward.

In the meantime, if I were you and I just wanted to get it working again, I'd export a local backup, uninstall/reinstall, and import the backup. Maybe make a copy of your DB folder beforehand, and store it elsewhere, if you wanna be extra careful.

C:\Users\YourUserName\AppData\Local\Google\Chrome\User Data\Default\IndexedDB\chrome-extension_clngdbkpkpeebahjckkjfobafhncgmne_0.indexeddb.leveldb

Hopefully these are isolated incidents, but that remains to be seen. Let us know if re-installing resolves these issues.

@narcolepticinsomniac
Copy link
Member

Oh, and delete all the redundant Super Mario test styles you've installed first, if at all possible. It shouldn't be letting that happen to begin with.

@eight04
Copy link
Collaborator

eight04 commented Feb 7, 2020

Could you try executing the following command in the manager's debugging console?

await chromeLocal.get(["dbInChromeStorage", "dbInChromeStorageReason"]);

@nastajus
Copy link
Author

nastajus commented Feb 7, 2020

Could you try executing the following command in the manager's debugging console?

await chromeLocal.get(["dbInChromeStorage", "dbInChromeStorageReason"]);

Sorry I'm not sure where to execute that, can you direct me? I haven't developed or debugged an extension before. I couldn't find a debug console to accept javascript anywhere in the manager inside the extension, and read through the https://github.com/openstyles/stylus/wiki/Manager and https://github.com/openstyles/stylus README.MD briefly just now. Maybe I'm missing something obvious?

I doubt you mean Chrome's console, which returns true btw.
image

This is what I see in the extension with options visible. I looked for a button or link to open up some kind of interactive console to allow JavaScript to be run, but didn't see it. Maybe I'm going blind 😏
image

@eight04
Copy link
Collaborator

eight04 commented Feb 7, 2020

I doubt you mean Chrome's console, which returns true btw.

Yes, you are right.

I can reproduce this issue by setting localStorage.dbInChromeStorage to "true".

@eight04
Copy link
Collaborator

eight04 commented Feb 7, 2020

https://github.com/openstyles/stylus/blame/79c6506c5cf143c8de6973bb126614bc037df347/background/storage.js#L143
The return type is wrong. It has been broken 3 years ago. I'll push a fix later.

@nastajus
Copy link
Author

nastajus commented Feb 8, 2020

@eight04 did your investigation clarify anything on why this issue starting appearing now?

@nastajus
Copy link
Author

nastajus commented Feb 8, 2020

Hopefully these are isolated incidents, but that remains to be seen. Let us know if re-installing resolves these issues.

I've reinstalled, problem's gone. Successfully re-imported my 100+ styles, tried toggling on a few sites, tried installing and uninstalling a few new styles -- everything's working as it did before. Didn't even need to restart Chrome. I'll keep an eye on this setup for a few more days if any more problems return, but I largely suspect the issue's gone for now.

@narcolepticinsomniac thank you for your prompt & thorough reply! Love to see open projects that are quickly attended to with exemplary care 😄! And to @eight04 for reproducing and isolating 😃

@eight04
Copy link
Collaborator

eight04 commented Feb 10, 2020

did your investigation clarify anything on why this issue starting appearing now?

No. However, I can confirm that modifying a style (including toggling enabled state) won't trigger this bug in 1.5.6 because we don't use the result object at that time.

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

Successfully merging a pull request may close this issue.

3 participants