louisbarclay / nudge

Nudge makes the internet less addictive.
https://nudgeware.io
MIT License
145 stars 9 forks source link

Nudge settings reset #73

Closed aadilayub closed 4 years ago

aadilayub commented 4 years ago

Over the past few weeks, I've noticed Nudge randomly stops nudging the sites in my list. This has happened a few times. When I go and check the extension settings, I find that the "Choose your Nudge Sites" list is empty.

Maybe the list is being reset every time the extension receives an update?

aadilayub commented 4 years ago

Update: I checked the settings again and it seems all the features turned off, not just the nudged sites list

aadilayub commented 4 years ago

Update: this is happening quite frequently; every other day I think. In addition, I am getting the TypeError in the sites chooser mentioned in #70

louisbarclay commented 4 years ago

This is really bad. Sorry. Going to look into it in the next week or so, and generally revamp the way settings work so this kind of thing can't happen.

aadilayub commented 4 years ago

@lgwb89 no worries. Looking forward to the revamp! Let me know if there's any way to help out

louisbarclay commented 4 years ago

It looks like this is an issue that's been affecting quite a few users. I still haven't managed to reproduce. Working on it.

louisbarclay commented 4 years ago

I've released an update where settings are (hopefully) managed better and more simply. Also, it includes a migration of settings format to a new format so that any bugs in users' settings (e.g. type issues) are got rid of. @aadilayub can you please let me know if you are still experiencing this bug? If not, I recommend we close this.

louisbarclay commented 4 years ago

Update: I've been reported that this bug still exists. I'm screensharing later today with someone who has it (since I've never been able to reproduce), and hope I'll be able to sort it out finally.

@aadilayub if you are able to get any more evidence/logs for this, would be greatly appreciated.

aadilayub commented 4 years ago

@lgwb89 I'll try out the new update on a fresh browser profile tomorrow and report back. :crossed_fingers:

aadilayub commented 4 years ago

I can confirm that the bug still exists. Experienced it on both Brave and Chromium today (sites list was empty, all features had been turned off). I don't know how to provide evidence/logs for it since its hard to tell when the settings reset occurs.

However, I did notice this error in the console on the sites chooser screen

Uncaught (in promise) ReferenceError: runSites is not defined
    at option.js:184

image

louisbarclay commented 4 years ago

Thanks a lot. I think it might be because the order of the JS files on sites.html is bad. option.js precedes sites.js which has the runSites function in it. I'd be interested in your opinion of this diagnosis. I'm releasing a fix to change this - should arrive in a couple of days, and it's on GitHub already - so let's see if the problem still happens after that.

Couple of questions:

louisbarclay commented 4 years ago

Ah sorry - I just noticed when you said 'all features had been turned off'. Got it.

aadilayub commented 4 years ago

Happened again today on Brave. This time, all the other settings were active but the sites list had been cleared.

image

Got the same error as before:

Uncaught (in promise) ReferenceError: runSites is not defined
    at option.js:184

Running await loadSettingsRequest() in the sites chooser outputs this:

{daily_goal: false, dev: false, div_hider: false, fb_auto_unfollow: false, fb_grey: false, …}
daily_goal: false
dev: false
div_hider: false
fb_auto_unfollow: false
fb_grey: false
fb_hide_notifications: false
fb_profile_ratio: false
get_stickier: false
install_date: false
last_seen_day: "2020-05-02"
nudge_domains: []
off_by_default: false
on_domains: []
paid: false
schedule: false
scroll_nudge: false
settings_version: 2
share_data: true
snooze: {all: 0}
stop_autoplay: false
time_nudge: false
unhidden_hidees: []
userId: "c2d9e7a6e67aa5ebef942a92c911b75dd01553332f3583ce514f51257b303264"
whitelist_domains: []
__proto__: Object

In this screenshot you can see the result of inspecting the background page, as well as the result of await loadSettings()

image

louisbarclay commented 4 years ago

OK - this is really helpful. I think it might be caused by everySecond running before the rest of the app has initialised, which somehow sets last_seen_day and overrides all other settings. Working on it now.

louisbarclay commented 4 years ago

I've released the fix to this. Should arrive on Web Store by end of this week. More information on my diagnosis of the bug below.

louisbarclay commented 4 years ago

Has anyone experienced this bug in the latest release, which is 1.0.65? You can check Nudge version number like this:

Let me know if you have/do.

aadilayub commented 4 years ago

Haven't experienced the bug on this new release. I'd give it a few more days to make sure, though.

louisbarclay commented 4 years ago

Thank you for the update.

louisbarclay commented 4 years ago

I'm closing this ticket since I'm pretty sure the problem is gone.