Page 1 of 1

[SOLVED] SC: changed scripts don't auto-reload (anymore)

Posted: 04 Oct 2025 18:07
by Filehero
Some weeks ago I started to refactor some of my scripts (prep for TB64 migration).

For unknown reasons I notice(d) that every once in while only the first external script change is reflected by the running XY instance. Any follow-up change needs a XY restart to come alive. So far, I've failed to see any real pattern. One day all works well, the other day it's screwed.

Today it's happening again. I simply comment toggle a msg command in VSCode. The first uncomment triggers the message box, every other change from now on stays ignored on the next script call. A Windows restart doesn't help.

In the log below, the example script file is in the folder referenced, which is also the location of the focused tab.

The first listed "event": code un-commented -> Msg box is shown
The second listed "event": code commented out -> Msg box is still shown
XY restarted -> Msg box is gone

Code: Select all

XYplorer 27.20.0006 (32-bit)  -  Lifetime License Enterprise  -  Windows 11 Pro, 64-bit, Version 24H2, Build 26100.6584 (10.0)  -  2025-10-04 17:58:48
======================================================================================================================================================

           0  -  2025-10-04 17:58:21.719  L--  fully loaded
----------------------------------------------------------------------------------------------------
      13.294  -  2025-10-04 17:58:35.013  L--  CheckWatch.ChangeDetected-B (24)
           0  -  2025-10-04 17:58:35.013  L--  WUL.List1.SetDelay on 24 -> C:\MyPortableApps\utilities\XYplorer\data\scripts\libs\
         312  -  2025-10-04 17:58:35.325  L--  > delayed ListRefresh Pane 1: Wahr
----------------------------------------------------------------------------------------------------
       7.030  -  2025-10-04 17:58:42.355  L--  CheckWatch.ChangeDetected-B (24)
           0  -  2025-10-04 17:58:42.355  L--  WUL.List1.SetDelay on 24 -> C:\MyPortableApps\utilities\XYplorer\data\scripts\libs\
         311  -  2025-10-04 17:58:42.666  L--  > delayed ListRefresh Pane 1: Wahr
Some weird interference is going on here. A hidden, sticky cache? I also can't really backtrack it version-wise. Any hint what I could check next?

Re: SC: changed scripts don't auto-reload (anymore)

Posted: 05 Oct 2025 10:02
by admin
I also can't really backtrack it version-wise.
why not?

Re: SC: changed scripts don't auto-reload (anymore)

Posted: 05 Oct 2025 10:36
by Filehero
Time. I expect a cumbersome, tedious task (I can't repro it with simpler scripts). Off to Greece tomorrow.

Do you have a candidate version to jump back in time?

Re: SC: changed scripts don't auto-reload (anymore)

Posted: 05 Oct 2025 10:52
by admin
Not really.

Enjoy Greece! :beer:

Re: SC: changed scripts don't auto-reload (anymore)

Posted: 05 Oct 2025 11:01
by Filehero
Will do. Thanks Don. :)

Re: SC: changed scripts don't auto-reload (anymore)

Posted: 24 Oct 2025 08:13
by Filehero
I got it - the SC refresh/reload problem was introduced with 24.30.0119.

Code: Select all

v24.30.0119 - 2023-04-24 11:21
    % Scripting: Rewrote the speed booster added in v24.30.0113, this time it should work 
      better, and all the goodies are back:
      - Loading large script files over and over is now much faster.
      - Calling subs over and over in huge script resources is now much faster.
    ! Custom File Associations: On 20230121 a logic was implemented to open files in the default 
      browser when their path was a URL:
      - https:\\www.xyplorer.com\download\xyplorer_23.90.0429_beta.zip --> open in default browser
      - E:\Test\xyplorer_23.90.0429_beta.zip --> open in associated app
      However the new logic destroyed opening non-file-URLs in an associated browser:
      - https:\\www.xyplorer.com --> open in associated browser
      Fixed.




With the attached 7z-archive you'll find a boiled down recreation of the entire script source dependencies context I've come across my issue with. It consists of 5 script source files (scsourceA-B.xys). Fortunately the "sensor" is just one file (scsourceB.xys). "un7z" it in <xyscripts>, the entry point is load("<xyscripts>\refresh\scsourceA.xys");.

In snippets notation

Code: Select all

ScriptL
  load("<xyscripts>\refresh\scsourceA.xys");


Reproduction: flip-comment lines 20/21 in scsourceB.xys and run the entry script again -> nothing changes.

Code: Select all

function introduceYourself_B() {
  // return "Gotcha!!";
  return "May I introduce myself, I am ""scsource BBBB""!";
}
With XYplorer version 24.30.0118 flip-commenting the return statements matches the coder's expectation whereas doing the same from 24.30.0119 onwards requires a XYplorer restart for the code change to become effective.

Can be moved to Bug Reports.

Re: SC: changed scripts don't auto-reload (anymore)

Posted: 27 Oct 2025 12:02
by admin
Bingo! Should be fixed in next betas.

Re: SC: changed scripts don't auto-reload (anymore)

Posted: 27 Oct 2025 18:04
by Filehero

Code: Select all

v27.20.0103 - 2025-10-27 12:47
....
    ! Scripting: The speed booster added in v24.30.0119 - 2023-04-24 11:21 could suffer 
      from a stale cache if script files were modified between calls within the same XY 
      session. Fixed.
Fixed it. :-) Thanks