Mysterious bugs related to scripted custom columns in combination with tagitems

Things you’d like to miss in the future...
Post Reply
fishgod
Posts: 227
Joined: 03 Feb 2008 00:40
Location: Sankt Augustin (near Bonn), Germany

Mysterious bugs related to scripted custom columns in combination with tagitems

Post by fishgod »

1. Mysterious crash (close without any error-message) when using tagitems+wait in custom-column-script
Occoured to a quite complex and lengthy script, but I could nail it down to just a few lines of code with a clean config:

Custom-Column-Setup:
Create a Custom Column as shown in the screenshot and attach it to the current view.
xy-column-crash.png
xy-column-crash.png (9.73 KiB) Viewed 1284 times
Code as Text:

Code: Select all

"Test Crash"
  $item = "<cc_item>";
  $tag = 'do a lot of stuff';
  tagitems("ex16", $tag, $item); //write tag
  wait; //if this is removed everthing works fine ?!?
  return "OK";
When the script in the column is executed, XYplorer just closes immediately without any error messages and without saving the config, so I consider this as a crash.
Important thing here is that Trigger is set to List. If it is set to Browse, the crash does not occour, but other things happen (see 2 and 3 below).
If wait is removed, it also works fine.
If tagitems is removed, it also works fine.
(In this demonstration the wait-statement is rather useless, but as far as I understand the documentation I can keep XY responsive by periodically calling it, while running a long script. I couldn't test this because of the bug I'm reporting right now...)


2. Items on other pane duplicate after using tagitems in custom-column-script
3. Following Items after the first item with the script are not shown in the list

Custom-Column-Setup:
Basically same setup as above, but this time we set Trigger to Browse and remove the wait statement (as the wait makes no difference here):
xy-item-dupe.png
xy-item-dupe.png (9.37 KiB) Viewed 1284 times
Code as Text:

Code: Select all

"Test Duplicate"
  $item = "<cc_item>";
  $tag = 'do a lot of stuff';
  tagitems("ex16", $tag, $item); //write tag
  return "OK";
The behaviour does not occour when Trigger is set to List.
The behaviour does not occour when tagitems is not used.

Every time the script gets executed (first time when entering the folder with custom column (saved as folder-view), and also every time you hit F5), the items on the other pane duplicate.
This duplication is only a visual thing, if you switch panes and hit F5 everything is back to normal.
The upper pane also contains a second txt-file and the XYplorer.exe, which are not shown in the list.
xy-item-dupe-shown.png
xy-item-dupe-shown.png (53.7 KiB) Viewed 1284 times
Operating System: Win10 x64 / Win11 x64 / almost allways newest XY-beta
totally XYscripting-addicted

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Mysterious bugs related to scripted custom columns in combination with tagitems

Post by bdeshi »

fishgod wrote: 20 Aug 2019 15:45 but as far as I understand the documentation I can keep XY responsive by periodically calling it, while running a long script.
for what it's worth, wait 1; seems to work okay.

Don can explain the crash.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

admin
Site Admin
Posts: 60530
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Mysterious bugs related to scripted custom columns in combination with tagitems

Post by admin »

Interesting bug. Comes down to an undesired recursion. Too complex to explain. But easy to fix. Next beta...

admin
Site Admin
Posts: 60530
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Mysterious bugs related to scripted custom columns in combination with tagitems

Post by admin »

Fixed bug 2) and 3) as well. They were similar in nature but independent of the first.

Thanks for spotting these! :tup: :beer:

Post Reply