Roukys / HHauto

GNU General Public License v3.0
45 stars 44 forks source link

Bug [5.4-beta.28] - Script stops when paranoia mode is on #130

Closed dark-muffin closed 3 years ago

dark-muffin commented 3 years ago

Describe the bug After a timer for rest expires, script doesn't continue its operations, as if timer is still ongoing. There are no errors in console and the latest recod in debug log is "autoLoop Disabled", so I believe there is an issue with script's internal logic. See debug log and settings (had to rename json to txt to attach it here) attached. HH_DebugLog_1611220600595.log

To Reproduce

  1. Activate paranoia mode
  2. Wait until it starts rest timer
  3. Wait until timer expires
  4. Script doesnt resume operation

System: OS: Windows 10 Browser: Opera 73.0.3856.284 Script-Helper: Tampermonkey v4.11.6120 Script-Version: 5.4-beta.28 HH_SaveSettings_1611220607331.txt

OldRon1977 commented 3 years ago

I suggest you try a different browser like MS Edge. It looks like the script has sometimes problems with browsers that are not so widespread. It might be the script or the way Tampermonkey is supported by Opera... For MS Edge I can confirm, that the script (latest beta) runs fine even with paranoia activated.

dark-muffin commented 3 years ago

Tried it on latest Chrome and got the same result - it stopped after ~30 min casual rest. I'll continue investigating this, maybe I'll be able to pinpoint specific conditions when this happens... For now all I can say is that browser was minimized during the countdown, maybe that's the issue, though I'm not sure.

dark-muffin commented 3 years ago

Alright, I made additional tests and found out that it doesn't matter whether the browser is minimized or not, also looks like it doesn't matter which options are activated - as long as script has something to do, it stops each time the paranoia timer stops. Additionally, for Chrome with paranoia on, script does not activate automatically right after first load of the page: you have to manually reload the page or go somewhere from the main screen for it to start. Here is how the script state looks like right after main page is loaded for the first time: https://ibb.co/Rp4sG53.

I'm also attaching debug log for such situation, just in case: HH_DebugLog_1611935945199.log

OldRon1977 commented 3 years ago

Strange... I also did run the script under chrome, using Tampermonkey. It worked fine, no stops at all. Do you have other scripts or extensions running as well? Maybe the problem is caused by another trigger.

dark-muffin commented 3 years ago

Nope! The thing is that after you suggested to use a different browser, I specifically downloaded and installed the latest Chrome, then installed Tampermonkey on it and then installed the beta version of the script and reproduced the problem. So, it's fairly safe to say that the script is the only thing that runs there, everything else is left completely by default.

Strange indeed. Is there a way to pinpoint differences between mine and your configuration? Because I think that might be the root of the problem.

OldRon1977 commented 3 years ago

Here are my settings from the debug file, should be easy to compare via word :)

HHAuto.txt

I am using MS Edge again, but those are the same settings I used with Chrome...

Roukys commented 3 years ago

@dark-muffin seems most of your parameters are disabled is that normal ?

dark-muffin commented 3 years ago

@dark-muffin seems most of your parameters are disabled is that normal ?

Yep, I tried to check whether this behavior depends on options activated, so I disabled almost all of them eventually. See settings file from issue description, it's the one I use in real life.

Also, if you still will not be able to reproduce the issue, here is something for you: image It's a virtual machine image for VMPlayer with only Win10 and Chrome installed. Just launch the shortcut on desktop, login to Nutaku an you'll be able to see the issue. Reproduces for me each time.

OldRon1977 commented 3 years ago

@dark-muffin seems most of your parameters are disabled is that normal ?

Hmmm... seems like the debug-file is not correct then. Here is the screenshot according to the debug-file: image

Roukys commented 3 years ago

I only checked the last debug where it was mostly disabled ;)

downloading the VM ...

Roukys commented 3 years ago

the autoloop disabled is strange. loop should continue during paranoia

OldRon1977 commented 3 years ago

Yep... I also checked the debug. This debug and the screenshot should show the same, but they are not. I will do some more testing, maybe it is because of different open tabs. Otherwise we have a bug at the debug ;)

Roukys commented 3 years ago

the screenshot with undefined:undefined is an issue also

Roukys commented 3 years ago

@dark-muffin could you try with very last beta (I've fixed the log so it display caller function, to understand from where do come te autoloop disabled)

And please use your normal setting before producing the debug log

Roukys commented 3 years ago

last beta : https://github.com/Roukys/HHauto/raw/5.4-beta/HHAuto.user.js

dark-muffin commented 3 years ago

@dark-muffin could you try with very last beta (I've fixed the log so it display caller function, to understand from where do come te autoloop disabled)

And please use your normal setting before producing the debug log

Done. Here is how script state look right after the page loads for the first time: script state after load Corresponding debug log: HH_DebugLog_1612190542344_load.log

Here is how everything looks when rest timer expires: script state after timer Debug log: HH_DebugLog_1612192798711_timer.log

Settings file, which is made when my normal settings were set: HH_SaveSettings_1612190537217.txt

(all files made under 5.4-beta.32)

Roukys commented 3 years ago

thanks I'll check on that :)

Roukys commented 3 years ago

I do see strange things : "localStorage.HHAuto_Setting_autoPowerPlacesIndexFilter": "undefined;undefined;undefined;undefined;undefined;undefined;undefined;undefined;undefined",

dark-muffin commented 3 years ago

Ah, yes, this must be related to power places numbers bug reported here earlier (can't find the issue, must be closed already): when you activate "Auto power places" option script scans power places and this is what it puts in the settings afterwards. I noticed it and then just disabled power places switch.

Most likely not related to our stopping issue here since power places broke after one of the game updates (last week probably) and I discovered hanging issue way before that, when the Patch of Doom was announced.

Roukys commented 3 years ago

ok :) normally last version should correct.

I'm trying to execute your VM :) (just need to export it to virtualBox :))

However I do see the last logs are Opera, and I think it does not work to well with it.

dark-muffin commented 3 years ago

You are right, latest logs were made under Opera since I haven't seen any differences in behaviour from Chrome. I can reproduce this under Chrome and attach new logs, if you need.

Roukys commented 3 years ago

I'll try and execute first your VM.

that is a very strange behavior indeed ...

Roukys commented 3 years ago

in your last logs : "2021-02-01T14:44:46.548Z:flipParanoia:\"PARANOIA: Casual rest\"", "2021-02-01T14:44:46.548Z:setTimer:\"paranoiaSwitch set to 18659:20:18:15 (33:29)\"", "2021-02-01T15:18:16.340Z:flipParanoia:\"PARANOIA: Casual burst\"", "2021-02-01T15:18:16.342Z:setTimer:\"paranoiaSwitch set to 18659:20:21:06 (02:50)\"", "2021-02-01T15:18:16.343Z:autoLoop:\"autoLoop Disabled\"", ""

meaning that script does start back after rest. but then autoloop seems disabled

I would say it is line 3370 : window.top.location.reload(); that does not do the reload on your side

could you try and put a : top.location.reload(true);

instead ?

dark-muffin commented 3 years ago

I think it should be line 3770 instead of 3370. Changed it as you specified, but this thing decided to go to sleep for 8 hours... Can you tell me where I can change value of the timers for all paranoia phases to facilitate testing?

Roukys commented 3 years ago

strange 8h is for midnight. http://css-workshop.com/check-cookies-local-and-session-storage-in-ie11-chrome-opera-and-firefox/#:~:text=In%20Opera%20you%20must%20click,%E2%80%9CCookies%E2%80%9D%20and%20explore%20it.

find storage and a key named HHAuto_Temp_Timers in sessionStorage.

Clear it and reload

PS it does remind me I wanted to do a debug menu to help with reset temp vars ...

dark-muffin commented 3 years ago

strange 8h is for midnight.

It was around 23:00 according to my local time when script switched to sleep rest.

Okay, tried modified script, the issue still persists. New debug log is attached: HH_DebugLog_1612238704138.log

Roukys commented 3 years ago

my current understanding is that the issue is that new page does not seems to load ... But I'm still unable to reproduce but just realized that you're using nutaku...

@OldRon1977 you're using nutaku or only hentaiheroes ?

I don't know how many people are playing on nutaku.

Can you put back 3370 to : window.top.location.reload();

and replace 3365 window.top.postMessage({reloadMe:true},'*'); with window.top.location.reload();

OldRon1977 commented 3 years ago

I use hentaiheroes...

Roukys commented 3 years ago

that's why we can't reproduce ... @dark-muffin sorry just realized you were using nutaku ...

Roukys commented 3 years ago

@dark-muffin I've created an account on nutaku.

As it is executing in a subwindow I need to understand how to deal with...

seems you should replace window.top.postMessage({reloadMe:true},'*'); with location.reload();

is there other functionalities you've seen not working there ?

dark-muffin commented 3 years ago

seems you should replace window.top.postMessage({reloadMe:true},'*'); with location.reload();

Tried this and confirm that issue is no longer present.

is there other functionalities you've seen not working there ?

Nope! Everything else seems to be working fine, at least features that I use. If I found such problems I would've created a ticket here as usual.

Roukys commented 3 years ago

thanks @dark-muffin, with your confirmation I'm updating the beta with modification :)

Roukys commented 3 years ago

@dark-muffin it is fixed in last beta