Scripting Bugs

Things you’d like to miss in the future...
TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Scripting Bugs

Post by TheQwerty »

zer0 wrote:While there's a debate to be had that whether an earlier, unchanged-by-user default should be overridden by a newer default, the fact that it does not do so isn't a bug in its "face value" sense, but may be an inconvenience...
You're being ridiculous... How is XY supposed to know that the unchanged-by-user default means that the user actually wants to always use the default and not that the user actually wants to use what was the default in the previous version?

If the next version of XY defaulted to not showing the confirmation dialog on deletes, I sure as heck bet you wouldn't think it wise for XY to just assume anyone that was using the default in previous versions wants the new default setting.

zer0 wrote:... (or more as I lost 10GB of data through this "inconvenience" :evil: ).
It's no one's fault but your own that you are throwing caution to the wind and avoiding the prompts with your use of "delete 1,0,;". The confirmation exists not only to affirm the user's decision, but also to allow them to confirm that the selection matches what they wanted to delete.

As you already know, scripting is a very powerful feature - go ask FDR and Spider-Man what comes hand-in-hand with that great power.

zer0
Posts: 2673
Joined: 19 Jan 2009 20:11

Re: Scripting Bugs

Post by zer0 »

TheQwerty wrote:You're being ridiculous... How is XY supposed to know that the unchanged-by-user default means that the user actually wants to always use the default and not that the user actually wants to use what was the default in the previous version?
It's a double-edged sword, it really is. Going out on a limb, I do not think that in most cases there'd be harm in going from an old default to an "updated" default. At least on the tweak level, that is, where most things I'd say are of the "set it and forget it" type.
TheQwerty wrote:If the next version of XY defaulted to not showing the confirmation dialog on deletes, I sure as heck bet you wouldn't think it wise for XY to just assume anyone that was using the default in previous versions wants the new default setting.
Bit of an extreme example, that one. And it's a GUI-level change rather than tweak-level, so it's doesn't fit in.
TheQwerty wrote:It's no one's fault but your own that you are throwing caution to the wind and avoiding the prompts with your use of "delete 1,0,;". The confirmation exists not only to affirm the user's decision, but also to allow them to confirm that the selection matches what they wanted to delete.
I used to have a confirmation prompt. But, with XYplorer being so reliable 99+% of the time, I removed it and had no unwanted consequences until now. Granted, I took a risk, but I feel that it was justified given XYplorer's reliability record and that this issue is caused by a bug in XYcopy.
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Scripting Bugs

Post by TheQwerty »

zer0 wrote:At least on the tweak level, that is, where most things I'd say are of the "set it and forget it" type.
This is also why it is much more dangerous to just change the value on the user instead of respecting their decision. If the user has accepted (even passively) the default value then they already have an expectation of how XY operates given that setting. Changing that value on them changes how XY works which means when they, like yourself, don't read the change log close enough they get bitten by the fact that their settings changed.
zer0 wrote:Bit of an extreme example, that one. And it's a GUI-level change rather than tweak-level, so it's doesn't fit in.
Not at all; a setting is a setting - whether it has a corresponding control within the GUI does not matter. Again, the user has approved of that setting and has expectations that shouldn't be broken when updating. Even if the user doesn't know the tweak exists, they have passively approved the behavior by not seeking out ways to change it.
zer0 wrote:... and that this issue is caused by a bug in XYcopy.
You've yet to prove this to be the case. Without testing your script I've already pointed to three sections of it that can cause problems in certain circumstances, and you've yet to respond with any indication of continued failure after addressing those.

Even if your script is broken as a result of XYCopy, it's unlikely a bug in XYCopy, but rather the fact that your script, like mine in that other thread, was designed with a certain understanding and expectation of how the file operation commands worked previously. The introduction of XYCopy has changed how those operations work and as a result our preconceived notion when creating the scripts are no longer entirely accurate or valid.

The script writer is responsible for keeping their scripts updated to match the changes in XY.

zer0
Posts: 2673
Joined: 19 Jan 2009 20:11

Re: Scripting Bugs

Post by zer0 »

TheQwerty wrote:This is also why it is much more dangerous to just change the value on the user instead of respecting their decision. If the user has accepted (even passively) the default value then they already have an expectation of how XY operates given that setting. Changing that value on them changes how XY works which means when they, like yourself, don't read the change log close enough they get bitten by the fact that their settings changed.
I don't necessarily agree with that. In order to respect a user's decision, one has to assume that a user has purposefully made such a decision. And if a user accepts a particular default value passively, he/she may not form said expectation. Actually, I'd say that most users don't read changelogs -- they want to use the app instead -- and if they do then they'd seek parts that may be relevant to them rather scrupulously examine them in detail.

Not reading the changelog with a loupe shouldn't be punished. What's worse: not reading the changelog and be bitten by a change one maybe should have made or not read the changelog and be bitten by changes to default values that Don made? Chances are that Don made such a decision for a good reason, but it still brings us back to that question: should or should we not assume that a user has made a purposeful decision to leave values as default and would that user object to default tweak values changing?
TheQwerty wrote:Not at all; a setting is a setting - whether it has a corresponding control within the GUI does not matter. Again, the user has approved of that setting and has expectations that shouldn't be broken when updating. Even if the user doesn't know the tweak exists, they have passively approved the behavior by not seeking out ways to change it.
Settings in GUI and INI are not the same, there are reasons for their segregation. Once again, why are we assuming that a user has approved that setting? When it comes to default values, aren't those values supposed to represent a "best case" scenario for users? So if they have passively/actively accepted said defaults, what speaks to the contrary of them also wanting to accept "updated" defaults? By your token, they can change them if they do not approve.
TheQwerty wrote:
zer0 wrote:... and that this issue is caused by a bug in XYcopy.
You've yet to prove this to be the case.
Having changed the BackgroundedFileOps tweak value from "14" to "7", I am no longer experiencing this problem. So, if I am correct, scripting's move command is incompatible with XYcopy if applied to intra-volume moving jobs?
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Scripting Bugs

Post by TheQwerty »

zer0 wrote:And if a user accepts a particular default value passively, he/she may not form said expectation. Actually, I'd say that most users don't read changelogs -- they want to use the app instead...
I never said they should have to read the changelogs, nor did I even suggest that to be the case. In fact, by not changing the user's settings to match changes to the defaults they should have less need to check the log, as XY is respecting their settings instead of using its own.


Since you balked about the deletion prompt example, let me break this down for you using:
; Tweak: Separator between RegExpPattern and ReplaceWith, Default = " > "
RegExpRenameSep=" > "
There are three possibilities for how this value gets set:
1) If the user does not know it exists they have passively accepted the default value.
2) If the user knows about the tweak but feels " > " is a good value they have directly accepted the value.
3) If the user knows about the tweak and changes it they have rejected the default value.

If in the next version of XY Don wanted to change it to " >> " by default what are his options:
A) Change it for everyone regardless of existing values.
B) If the existing value is " > " change it to " >> ".
C) Only use " >> " for new installations.

Option A is an awful user experience for everyone, agreed?

Option B is what you are pushing for, but how does Don discover whether the existing value is because of 1 or 2 above? Then assuming it is 1 you still confuse users because they have grown accustomed to using that setting within XY. It doesn't matter if they didn't know they could change it, their expectations have been set by previous use.

Option C does not change what the user has to do and it doesn't overwrite/delete the user's settings. To the user this is just like nothing changed and they are unaware until they either read the change log or do a fresh install. If the user is doing a fresh install I think it is acceptable that they'll expect the new install to not function exactly like their previous one did until it is configured similarly.


Option A and B are very disruptive to the user's workflow; option C is not.
Option A and B do require that the user pay attention to the change log as they never know when XY is going to decide to change their settings; option C only requires it when the user discovers that their value is no longer the default.

Now sure there is the possibility that a user who has never before used Regex Rename will begin using it and for them " >> " might be a better option, than the " > " they passively accepted, but how is XY supposed to determine this? This would require XY to essentially add two bits to each and every setting, one to track if it's been set by the user, and another just to see if it's been used.

What a waste of effort that would be, in addition to creating a much more complicated code base, just to make things easier for a fraction of the minority of users for something that is rarely an issue at all.

zer0 wrote:Settings in GUI and INI are not the same, there are reasons for their segregation.
They are only segregated for the sake of simplicity. There is no need to present a new user with all those options, especially when some are needed by so few. However, there is no actual difference between a setting in the GUI and the INI. They are both settings and they both change how XY behaves. The user does not become accustomed to which checks and values are set, they develop habits and expectations by how XY behaves.

zer0 wrote:Once again, why are we assuming that a user has approved that setting? When it comes to default values, aren't those values supposed to represent a "best case" scenario for users?
No, they are not. Default values define the initial behavior of XY and the goal when determining how they should be set all comes down to selling XY. That's it - it's not about the best case, that's different for each user. It's what would be most appealing to a prospective customer to convince them to buy XY. Often these default values also correspond to better performance or ideal settings for the majority of users, but, again, the goal is to sell XY not achieve that be-all-end-all of subjective best case scenario.

zer0 wrote:Having changed the BackgroundedFileOps tweak value from "14" to "7", I am no longer experiencing this problem. So, if I am correct, scripting's move command is incompatible with XYcopy if applied to intra-volume moving jobs?
The move scripting command works perfectly with XYcopy as far as I can tell. There is no incompatibility because it respects a user's settings for what operations should be done in the background, and if the user wants the script to use a different behavior than the global setting they can use the setting command to do just that.


EDIT: Not that this wall of text needs to be bigger, but as we've determined that the problem was script writer error and is thus resolved I have no intentions of continuing this discussion.

zer0
Posts: 2673
Joined: 19 Jan 2009 20:11

Re: Scripting Bugs

Post by zer0 »

Without quoting that wall of text, there is a reason why an exception should have been made in the case of not overwriting the defaults with "updated" defaults. This reason is because there was a maintenance release between when that tweak was first introduced with default value "14" and when it was changed to "7". Therefore, people who don't read the changelog would have got "14" and it wouldn't change at the next stable release as per current policy.

As for the script error itself, I still don't see where I have gone wrong. I have asked the move command to move a file. With intra-volume included [in the tweak value], the move doesn't happen. Once it's turned off, the move is all good. In step mode, all is good also. What makes intra-volume moves via scripting so special that XYcopy doesn't handle it as well (or shall I say as expected?) as it used to?
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Scripting Bugs

Post by TheQwerty »

I kept forgetting to report this one..

When exiting XY via script command (#190 & #192 at least) the last couple of betas, v9.00.0217, generate a
Run-time error '91':
Object variable or With block variable not set
followed by XP's standard
XYplorer.exe has encountered a problem... blah blah

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Scripting Bugs

Post by TheQwerty »

zer0 wrote:As for the script error itself, I still don't see where I have gone wrong. I have asked the move command to move a file. With intra-volume included [in the tweak value], the move doesn't happen. Once it's turned off, the move is all good. In step mode, all is good also. What makes intra-volume moves via scripting so special that XYcopy doesn't handle it as well (or shall I say as expected?) as it used to?
Sorry, missed your reply. I think the move attempts to happen but having background processing (for intra-volume as well) enabled causes the script to send the move command to XYcopy and then proceed to the next command. Perhaps it's getting to the delete before XYcopy initializes and performs the move.

The difference being that before XYcopy existed the command was blocking so it wouldn't continue until the move was complete.

zer0
Posts: 2673
Joined: 19 Jan 2009 20:11

Re: Scripting Bugs

Post by zer0 »

TheQwerty wrote:Perhaps it's getting to the delete before XYcopy initializes and performs the move.
I think so too. In this case, scripting should request and await a response from XYcopy before proceeding.
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Scripting Bugs

Post by TheQwerty »

zer0 wrote:
TheQwerty wrote:Perhaps it's getting to the delete before XYcopy initializes and performs the move.
I think so too. In this case, scripting should request and await a response from XYcopy before proceeding.
The easy way to fix it today is to place a "Setting('BackgroundFileOps', 0);" before the first file op in a script which you want to wait for, and any subsequent if you want to toggle it back.

While I admit to finding this annoying, I think it's a sufficient solution and it actually gives the script writer quite a lot of control. Further, I'm not sure what a better solution would actually be?


Don, I know you told me you couldn't add a tweak which made all scripted file ops occur in the foreground and be blocking, as they were before XYcopy. But couldn't you add a tweak that forces a "Setting('BackgroundFileOps', 0);" before every script? That seems like it would be incredibly easy to do; like most things when you cannot see the source. ;)

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

Re: Scripting Bugs

Post by admin »

TheQwerty wrote:I kept forgetting to report this one..

When exiting XY via script command (#190 & #192 at least) the last couple of betas, v9.00.0217, generate a
Run-time error '91':
Object variable or With block variable not set
followed by XP's standard
XYplorer.exe has encountered a problem... blah blah
Cannot reproduce. There must be some unknown factor. Also with fresh installation?

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

Re: Scripting Bugs

Post by admin »

TheQwerty wrote:Don, I know you told me you couldn't add a tweak which made all scripted file ops occur in the foreground and be blocking, as they were before XYcopy. But couldn't you add a tweak that forces a "Setting('BackgroundFileOps', 0);" before every script? That seems like it would be incredibly easy to do; like most things when you cannot see the source. ;)
Not sure yet...

zer0
Posts: 2673
Joined: 19 Jan 2009 20:11

Re: Scripting Bugs

Post by zer0 »

TheQwerty wrote:The easy way to fix it today is to place a "Setting('BackgroundFileOps', 0);" before the first file op in a script which you want to wait for, and any subsequent if you want to toggle it back.

While I admit to finding this annoying, I think it's a sufficient solution and it actually gives the script writer quite a lot of control. Further, I'm not sure what a better solution would actually be?
An easy fix was also to exclude intra-volume file ops from being handled by XYcopy, which is what I have done. A better solution would be to establish a type of a delayed-response mechanism between scripting and XYcopy as follows:

a) The scripting engine tells XYcopy to move a file. In the meantime, the script does not continue to execute.
b) Presumably, XYcopy knows once a job is finished. It sends an "all clear" signal to the scripting engine.
c) Scripting engine receives this signal and resumes parsing the remainder of a script.

Such close integration would be really useful. Otherwise, why be able to use XYcopy for intra-volume moves using scripting at all as opposed to how things were in the past?
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Scripting Bugs

Post by TheQwerty »

admin wrote:Cannot reproduce. There must be some unknown factor. Also with fresh installation?
Completely untouched copy of v9.00.217, using "::#190;", "::#191;" or "::#192;" in the AB results in:
Error 91 (0000005B)
Desc Object variable or With block variable not set
Dll 0
Proc IB@75

Source XYplorer
XY ver 9.00.0217
OS Windows XP (Service Pack 3)
Date 5/6/2010 6:48:23 AM
Occasionally I'll see that dialog twice and then a third that says:
Run-time error '364':

Application-defined or object-defined error

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

Re: Scripting Bugs

Post by admin »

Ah yes, confirmed. But I don't see how this could be a very recent error. From the source code it looks like it was born 20090801.

Post Reply