DmitriySalnikov / OBSNotifier

Simple program for displaying notifications from OBS on your desktop.
MIT License
51 stars 1 forks source link

[Bug]: Application randomly resets after boot. #10

Open Metazolid opened 1 year ago

Metazolid commented 1 year ago

Commit or version

1.2.1

On which operating systems the error occurs

Windows

Issue description

Running Windows 10, OBS 29.1.3 I have OBS set up to run minimized on boot with Replay buffer enabled and OBSNotifier is starting along with it, but sometimes the notifier settings window pops up and everything (besides the run at windows startup/start with OBS) seems to reset to default. No passwort set, all active active notifications enabled, etc.

Please let me know if there are any more details I can provide to help you out!

Steps to reproduce

N/A

DmitriySalnikov commented 1 year ago

I don't even have any idea what could be the reason to reset 🤷‍♂️. Try to read log.txt (%appdata%\OBSNotifier) immediately after the reset. Maybe some kind of exception will be mentioned there. By itself, loading the settings is just reading a json file. Either the file is simply not being created for you, or something is deleting it, or the file is locked. Although maybe I missed the formatting based on the region of the system somewhere and the wrong comma is written somewhere. You can also send a settings file (it stores the password, so you can delete it first).

Metazolid commented 1 year ago

It just happened again, I had to kill OBSNotifier otherwise I couldn't open the .log log.txt

Checking the settings.json (here attached as a .txt so Github lets me upload it), it seems just be reset to default. settings - Copy.json.txt

My uneducated guess is as follows; OBSNotifier sometimes, somehow starts the connection process before OBS is ready, can't establish a connection and during that process overwrites the settings file. I checked my startup programs to make sure I didnt add OBSN by mistake but it's only starting via the obs script. It might be noteworthy that I don't have a password set to connect OBSN to OBS with, I previously used it with a password but it apparently works without one as well so I didn't question it any further.

For now I'd probably just set the settings.json to read only and hope it helps, I dont know enough about programming or recreating the bug more frequently to see if a delay in the obs_notifier_autostart.lua could fix the issue.

DmitriySalnikov commented 1 year ago

OBSNotifier sometimes, somehow starts the connection process before OBS is ready

The connection can occur only after authorization on the OBS webscoket server (key and password exchange).

For now I'd probably just set the settings.json to read only and hope it helps

most likely, this will lead to the fact that with such a "broken startup", the settings will be reset and they will return at the next startup.

It seems that I also had strange freezes and resets (I'm not sure about the reasons for the reset), but this usually happened when the websocket broke after several restarts due to a port change and debugging breakpoints after port change. The port remained blocked until the OS was rebooted.

And also obs-websocket-dotnet by BarRaider sometimes works strangely. I am especially "pleased" with the inconvenient connection and the output of 300 errors (literally) when disconnecting due to changing the password of the server.


I've run OBS 20 times and no problems. I tried to close it normally, killed it and OBSN separately, killed them at the same time. But no problem.

I had another guess. Perhaps you somehow save the settings before turning off the PC, but this saving does not have time to complete. When saving, the settings file is usually cleared, the file buffer is filled, and then this buffer is written to disk. Probably the file does not have time to be written (however, there are only a few KB). Can you check for the contents of the file after your usual shutdown of the PC with the enabled OBSN before the reset occurs?