digitalcreations / MaxTo

Public issue tracker for MaxTo
https://docs.maxto.net
76 stars 5 forks source link

"Window" selection in ingredient randomly changing #639

Closed manuelhuber closed 3 years ago

manuelhuber commented 3 years ago

Describe the bug The settings of my ingredient keep changing randomly, sometimes when I execute the recipe, sometimes when I leave the recipe menu and come back and sometimes just while switching from one ingredient to another within the same recipe. I've mainly observed this issues with the "window" setting where it will go from "Search for Window" to "Foreground Window" or to not selection at all. The json of the recipe is also updated - so it's not just a display bug, the actual recipe changes.

Video In the video I regularly click outside of MaxTo - I'm just refreshing Notepad++ to see how the recipe in the config.json looks (unfortunately it didn't record that). The config.json regularly updates though sometimes it is out of sync with what's displayed but it does change the ingredients in the json by itself. When you see the loading spinner around the mouse I'm executing the recipe. https://www.youtube.com/watch?v=VZGbpGbZn1k

System information:

Additional context My logs (there's a whole bunch of exceptions in there - I've been having trouble with MaxTo all day) maxto20201031.log My config (as .txt since json isn't allowed): config.txt

This is the ingredient:

{
      "name": "_LoadLeftMonitor",
      "hotkey": null,
      "triggers": [
        {
          "type": "keyboard:hotkey",
          "Hotkey": "Windows+NumPad0"
        },
        {
          "type": "monitor:connected",
          "Monitor": "L5LMQS024838"
        }
      ],
      "ingredients": [
        {
          "command": "uncategorized:launch",
          "parameters": {
            "executable": "%LOCALAPPDATA%\\WhatsApp\\WhatsApp.exe",
            "waitforinputidle": true,
            "bringtofront": true,
            "waitforwindow": "\\\\\\"
          }
        },
        {
          "command": "uncategorized:launch",
          "parameters": {
            "executable": "%APPDATA%\\Spotify\\Spotify.exe",
            "waitforinputidle": true,
            "waitforwindow": "\\\\\\"
          }
        },
        {
          "command": "uncategorized:launch",
          "parameters": {
            "executable": "%LOCALAPPDATA%\\Discord\\Update.exe",
            "arguments": "--processStart Discord.exe",
            "waitforinputidle": true,
            "waitforwindow": "\\\\\\"
          }
        },
        {
          "command": "window:move",
          "parameters": {
            "window": "\\\\\\*Spotify*",
            "monitor": "L5LMQS024838",
            "region": "top left",
            "virtualdesktop": null
          }
        },
        {
          "command": "window:move",
          "parameters": {
            "window": "\\\\\\WhatsApp",
            "monitor": "L5LMQS024838",
            "region": "bottom left"
          }
        },
        {
          "command": "window:move",
          "parameters": {
            "window": "\\\\\\* - Discord",
            "monitor": "L5LMQS024838",
            "region": "center"
          }
        }
      ]
    }
}
vegardlarsen commented 3 years ago

Thank you for the detailed report. I will be looking at this this coming week.

My hunch is that this saves correctly if you check "Search for window" and ensure your details are filled in before pressing "Save changes", and whenever you open a page and immediately hit "Save changes" when neither of the radio buttons are checked, it will save the incorrect value.

manuelhuber commented 3 years ago

whenever you open a page and immediately hit "Save changes" when neither of the radio buttons are checked, it will save the incorrect value.

When you look at the video at the very start I go through all 3 ingredients. Each one has a value selected when I press save. Later on, when I switch back to an ingredient it will sometimes have no value selected (which I don't understand - why is it changing without my input?) but then I still select an option before pressing save. In those cases where all of a sudden nothing is selected, the json of the ingredient will be "window": null

manuelhuber commented 3 years ago

I think I've pinpointed the issue a bit more! I can now consistently reproduce the issue!

Steps:

  1. Open _LoadLeftMonitor recipe
  2. Click on one of the three "move" ingredients
  3. The first one you click will have the "Search Window" selected (as expected)
  4. The second one you click will have nothing selected (doesn't matter which ingredient!) <- Unexpected behavior
  5. Clicking back and forth between the ingredients causes seemingly random behavior where they have either "Search", "Foreground" or nothing selected <- Unexpected behavior

Made a new video: https://youtu.be/d7vaySIO7ow

This is the state that's on disk: 2020-11-01 12_51_26-C__Users_nelo1_AppData_Roaming_MaxTo_config json - Notepad++

Clicking on one "move" ingredient and then another will cause it to have nothing selected: 2020-11-01 12_51_39-C__Users_nelo1_AppData_Roaming_MaxTo_config json - Notepad++

If I press back it tells me I have made changes: 2020-11-01 12_51_57-C__Users_nelo1_AppData_Roaming_MaxTo_config json - Notepad++

vegardlarsen commented 3 years ago

I've been debugging this specific issue for 4 hours now, and I can easily reproduce it. The corruption happens when you switch back to an ingredient that has been displayed before, if any other ingredient that has a Window argument has been selected in the mean-time.

However, I am having a much harder time actually figuring out why it changes.

vegardlarsen commented 3 years ago

As I haven't been able to solve this issue, I've decided to avoid it by removing the radio buttons (which were the cause of the issue). The new UI isn't as intuitive, but at least it works consistently.

image

Will be in 2.1.1.

Edit: English