betterttv icon indicating copy to clipboard operation
betterttv copied to clipboard

bttv forgets settings on Firefox 91

Open bottleblue opened this issue 4 years ago • 27 comments

Ever since I updated to Firefox 90 bttv's been having trouble remembering the settings. I haven't made any changes. Bttv will just randomly lose settings. It could take a day or it could happen in a few hours. The only things I have selected when I clear my history are Browsing & Download History, Form & Search History, and Cache. I've cleared my history and restarted the browser and bttv's settings are fine. I've restarted my pc and shutdown my pc and bttv's settings are fine. But I can leave my browser open and look at some other site and come back to twitch and then the settings are gone. I can have a twitch tab open with bttv settings working, then open another twitch tab and then they are gone.

So I don't know what's going on. I disabled the cookie manager (which was working fine before w/ twitch whitelisted) and it still happens. I created a brand new firefox profile and the problem remains.

I noticed the default profile that firefox creates in C:\Users\name\AppData\Local\Mozilla\Firefox\Profiles doesn't have a Storage folder whereas my custom profile I normally use on a different drive does. Where is bttv storing its settings in the default profile?

I'm assuming bttv stores the info in the https+++www.twitch.tv folder in storage/default? This folder isn't getting deleted so why aren't the settings persisting? What's the exact filenames for the bttv settings?

Everytime this happens I have to re-import the bttv settings file, then disable Auto in Video quality, disable low latency, and enable timestamp which gets really annoying.

bottleblue avatar Aug 27 '21 11:08 bottleblue

You are not the only person to report this issue, although there have been very few, and all of them on Firefox 90+. First of all, make sure your Firefox is 100% up to date, as they released 91.0.2 a couple of days ago, and one of the issues fixed in that is related to improperly purging authentication data when purging "trackers", so that may be related, although it's unlikely.

It is also worth noting that storage of the video quality setting, low latency, and the timestamp setting are Twitch settings (although you are correct that BetterTTV does store its settings in the same place as Twitch does in local storage), and have nothing to do with BetterTTV, so it is extremely unlikely this is an issue with BetterTTV, as it is affecting things outside of our scope. BetterTTV's interaction with local storage is confined to set and get operations on keys prefixed with "bttv_". In legacy versions, the keys were stored individually, but in the new version, all settings are collected in the key "bttv_settings", and that is the only key we ever interact with. Our storage handler (src/storage.js) does not implement any code that can delete local storage keys, not even our own, much less Twitch's settings.

Nareese avatar Aug 27 '21 12:08 Nareese

Yea I already updated to 91.0.2 before I made my original post. Didn't help. I know that video quality settings, low latency, and timestamp aren't part of bttv but they get reset also and I have to configure it each time which adds to the problem.

BetterTTV's interaction with local storage is confined to set and get operations on keys prefixed with "bttv_". In legacy versions, the keys were stored individually, but in the new version, all settings are collected in the key "bttv_settings", and that is the only key we ever interact with. Our storage handler (src/storage.js) does not implement any code that can delete local storage keys, not even our own, much less Twitch's settings.

So bttv's not actually saving any files inside the twitch local storage folder? I don't see any files with the name bttv_ in the twitch storage folder.

bottleblue avatar Aug 27 '21 19:08 bottleblue

I'm not an expert on the local storage implementation in Firefox, so I am not going to attempt to explain how its implemented, but no, it's not "saving any files". It's a database, usually of the key/value variety. Everything for Twitch and all other third party apps that use Twitch's space, will be stored in a single file or a couple of files, not one per application. The browser supplies a set of javascript functions tied to the browser's "window" object, that allow fetching and saving data in that database. Data is saved to or retrieved from that file by specifying a "key". All of BetterTTV's keys start with "bttv_". The current version of our settings/storage system deals with one single key "bttv_settings", does not touch any other keys in the database.

The reason that I mentioned the other settings being Twitch's instead of BetterTTV's, is that BetterTTV will never touch those settings. So if they are being lost too, it's not BetterTTV that is doing it. I have no doubt that there is some problem here for you, and I'm sure it's an annoying problem, but it is not a BetterTTV problem if those settings are also being lost. Something outside of BetterTTV is removing them. It might be a bug in Twitch's storage handler. It might be a bug in Firefox itself. It may be some other third party application. It's impossible to say. But I can say with a high degree of confidence that it is not a bug in BetterTTV, and it is very unlikely that there is anything we can do to fix it. We use this system because it works exactly the same across all browsers that support local storage (which is pretty much all modern browsers). There is nothing Firefox specific in our code. If this was a general problem with BetterTTV's storage code, we would be seeing it on platforms other than FF 90+, and we aren't.

Nareese avatar Aug 27 '21 21:08 Nareese

Thx for explaining. I guess I'll just have to hope it's some bug on firefox's end and they fix it soon.

bottleblue avatar Aug 28 '21 01:08 bottleblue

This definitely sounds like a Firefox bug of sorts. I'll classify it as a bug but I'm not too sure if it's something we'll be able to mitigate.

night avatar Aug 28 '21 18:08 night

I'm wondering if it's a firefox addon that's causing it because the default profile that firefox created in Appdata/local folder that only has 3 addons, Ublock Origin, Privacy Badger, and Forget Me Not cookie manager, has not lost the bttv settings once while my main profile has plenty of times. But I don't have the patience to remove all my addons and add them back a few at a time and wait to see if bttv remembers the settings a day or two later.

bottleblue avatar Aug 31 '21 13:08 bottleblue

I'm wondering if it's a firefox addon that's causing it

That is, of course, entirely possible, and was one of the potential causes I mentioned (some other 3rd party application).

I don't have the patience to remove all my addons and add them back a few at a time...

One way to speed up that process is to do it in halves. Disable half your addons. Still happens? Re-enable those and disable the other half. Stops happening? Re-enable half of the ones in that disabled half. Still stopped? Re-enable half of the remaining disabled again, etc. If it starts happening again, disable what you just re-enabled and re-enable the other half of that, etc. It's the same thing, really, but just faster than one at a time.

Firefox is also notorious for "profile corruption", and one of the first things that Mozilla's official support will often recommend that you do if you are having "weird issues" is to completely delete and recreate your profile from scratch, never mind the hassle of losing all your cookies, settings, addons, everything in doing so. But in lieu of that, I might recommend that you create another separate non-default profile so you can keep your current one, and then add all of your current profile's addons to that profile, and see if that profile has issues with the full set of your chosen addons. If it does, then it is very likely that one of them is the cause, and it is unlikely you'll ever know which one without doing that one at a time and wait hassle. If, on the other hand, it doesn't happen with the new profile, then... problem solved.

Nareese avatar Aug 31 '21 15:08 Nareese

I'm familiar with the half method. The issue is that it can take up to a day for bttv to forget its settings and I have like 40 something addons installed. It would take awhile to find out. Some of them I really don't want to do without for even a short time, like the Twitch ads blocker addon. Seems like it's less hassle to re-import bttv's settings few times a day.

My main profile I'm using is a brand new profile I made for this purpose and it still occurs.

If the problem still happens after the next firefox update I'll commit to doing the half method and finding out for sure if it's an addon issue.

I'm actually quite done with firefox. The only reason I still use it is because of the variety of addons. I would have switched to Chrome long ago if it had all the addons I use. Maybe it does now but I'd have to search for them and that's more hassle.

bottleblue avatar Aug 31 '21 16:08 bottleblue

As a former FF primary user, I feel your pain. Good luck, I hope you're able to track this issue down.

Nareese avatar Aug 31 '21 18:08 Nareese

I've been having a different but vaguely similar problem for a while. Across different FF versions, not just a recent one, and with FFZ too (changing its Storage Provider setting from Local Storage to Indexed DB doesn't help). But I'm not regarding it as or reporting it as a bug to anyone, because it is most likely due to the cause, one way or another, of my FF setup being fairly hardened with a lot of privacy & security addons and tweaked settings, resulting in altered behavior, including of course automatic clearing of cookies and other persistent data. I use the Cookie Autodelete addon to do this with fine grained control, though I have also previously used FF's built in cookie management/clearing and exceptions, and experienced the same issue: though I still remain logged into Twitch, BTTV & FFZ both consistently forget their settings after I restart the browser. Twitch also forgets my dark theme choice, though not my login, for some reason. I've whitelisted Twitch domains (which works to prevent my login cookie from getting cleared). as well as any relevant BTTV & FFZ ones I could find, from deletion, so this is mystifying. I haven't nailed down the exact culprit and I cannot readily tell whether it's a bug of anything (possibly even in some seemingly-unrelated advanced FF privacy feature, such as First Party Isolation) or due to a misconfiguration on my part. I don't expect this to recur in a new profile, indeed.

I've gotten used to Importing my BTTV&FFZ settings back from files every browser restart, and this was made worse in a recent BTTV update with the settings UI redesign, where the Import Settings button is now buried specifically in the Emote Dashboard section, which, every time it is opened, opens and switches focus to a new tab (with https://betterttv.com/dashboard/emotes ), making the process considerably more annoying. It's actually hard to fathom the decisions of this specific behavior and the new location of the button both. They feel like bugs themselves. It would be helpful if instead of becoming more difficult, the import routine would become easier by the addition of a quick, direct Import Settings button on the home/default section of BTTV settings, or something like that. Possibly also removing the automatic refresh of the page post-import (like FFZ), unless it is strictly necessary, too.

Vagmer avatar Sep 07 '21 17:09 Vagmer

It would be helpful if instead of becoming more difficult, the import routine would become easier by the addition of a quick, direct Import Settings button on the home/default section of BTTV settings, or something like that. Possibly also removing the automatic refresh of the page post-import (like FFZ), unless it is strictly necessary, too.

The import button is actually on the About tab of the settings window (the very bottom "i" tab). It appears to be a side effect of the emote dashboard tab not having any actual content of it's own and just launching an external browser for the dashboard, that it then displays the content of the About tab (although it doesn't actually select that tab). I'm not sure why it was implemented this way, but you can bypass the dashboard launch tab switch by going directly to the About tab instead. It is unlikely that the auto-refresh will be removed, since many settings require a refresh to take effect, and having imported settings, most people would expect them to be immediately activated.

Nareese avatar Sep 07 '21 17:09 Nareese

That makes more sense. I didn't realize the (i) on the bottom was another clickable section marker - probably missed it completely until now. Thanks for the tip.

Vagmer avatar Sep 07 '21 20:09 Vagmer

I made the same mistake. You should move the i icon underneath the other icons

bottleblue avatar Sep 07 '21 21:09 bottleblue

I think this problem has been fixed in Firefox update 92. It's been 3 days and I haven't lost bttv or twitch settings yet. Must have been an issue with Firefox.

bottleblue avatar Sep 10 '21 15:09 bottleblue

I was having my settings get reset on brave as well.

Renari avatar Sep 13 '21 23:09 Renari

I don't know what brave is but have you tried updating to Firefox 92? The problem stopped once I updated. It's been almost a week and I haven't lost my settings on twitch.

bottleblue avatar Sep 13 '21 23:09 bottleblue

I don't know what brave is but have you tried updating to Firefox 92? The problem stopped once I updated. It's been almost a week and I haven't lost my settings on twitch.

It's a different browser: https://brave.com/

Renari avatar Sep 14 '21 00:09 Renari

Oh yea I've heard of that. I've never used it so I can't say. But if it was working before and then you updated the browser and it stopped working then it could very well be something with the browser.

bottleblue avatar Sep 14 '21 00:09 bottleblue

Oh yea I've heard of that. I've never used it so I can't say. But if it was working before and then you updated the browser and it stopped working then it could very well be something with the browser.

Browser wasn't updated, BTTV extension was, it happens infrequently though.

Renari avatar Sep 14 '21 03:09 Renari

I've never got this to working properly still and issue in both macOS and Windows, everytime you start a new session settings are simply not there, I wonder how these are actually saved, perhaps Firefox privacy features have something to do with it?

UPDATE: I see its saves the settings to local storage under the twitch.tv domain image

After closing the browser reopen, these are gone...

I know firefox introduced some breaking changes with the privacy settings for some extensions and local storage persistence (see https://bugzilla.mozilla.org/show_bug.cgi?id=1313401#c38) however this should have been fixed by https://bugzilla.mozilla.org/show_bug.cgi?id=1599979 so idk

for now I backup and restore when needed.

mike-pt avatar Mar 31 '22 22:03 mike-pt

Do you have the option "Delete cookies and site data when Firefox is closed" checked?

bottleblue avatar Apr 01 '22 09:04 bottleblue

No, otherwise that would just be expected behaviour, and I would have to login again to twitch/every site ofc...

This doesn't happen only on browser close, after awhile I simply have to redo everything, i.e. If I close twitch tab and only open twitch again in the next couple days, closing and re-opening the browser is just a easy way to test this.

STRICT mode is however enabled, which relates to the links above.

mike-pt avatar Apr 01 '22 09:04 mike-pt

ok just had to check the most obvious thing first. I've never had it not work the whole time. It was either a firefox or a bttv update that temporarily messed it up. If it's never worked for you it must be something else. An addon would be the most likely problem or maybe some custom config you did in about:config?

Have you tried creating a new firefox profile and only installing bttv?

bottleblue avatar Apr 01 '22 10:04 bottleblue

Yes, I've done all the basic debugging, I've I'm looking at webtools, the windows box was a new profile for my wife new laptop actually, until then I thought this was just something I had set wrong, but I never cared much to debug it further, when she alerted me that this is happening to her, I started searching and bump into this.

No custom configs... and in her case it was brand new install, she switched to Chrome for Twitch+bttv just cause of this, works fine there.

She does also have strict mode, Its the first thing I always set in FF, I haven't actually tested without it 🤔

mike-pt avatar Apr 01 '22 10:04 mike-pt

OK, now its just working fine on her's and I can't repo on just closing the browser (still has strict mode enabled) but she swears it hasn't been working for her ... WT

On my mac this is pretty consistent I can't test turning it further now but I will try latter.

mike-pt avatar Apr 01 '22 10:04 mike-pt

Idk what to say except try it with the most basic privacy restrictions. Good luck

bottleblue avatar Apr 01 '22 10:04 bottleblue

Ok that's not it, just tried on Firefox macos Standard privacy mode and this still happens on closing the browser, however I tried a new clean profile (in macOS) and its seem to work after restart... I will see what happens the next few days

mike-pt avatar Apr 01 '22 12:04 mike-pt

As we are still unable to reproduce this behavior and there hasn't been posts in a while, we will consider this issue resolved.

night avatar Oct 01 '22 02:10 night

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related issues or feature requests.

github-actions[bot] avatar Dec 30 '22 02:12 github-actions[bot]