Kicking myself now. I spent a good while on this last night before giving up and heading off to bed. I’d verified the error and proved it only happened in the test file, and seen the ‘1’ user attribute but didn’t join the dots.
For later readers, expanding on @eastgate’s description, this is a good example of where legacy usage support for old action code, before the days $-prefixes were needed, can bite. The issue is the user had (inadvertently) made a user attribute. This resulted in:
$SiblingOrder(original) - 1
being interpreted as:
$SiblingOrder(original) - $1
As the default for attribute ‘1’ was 0
(zero), this meant:
$SiblingOrder(original) - 0
Odd, when $SiblingOrder subtracted by any other value but 1
works!
I’ve made a note to reference this in my aTbRef article on suggested attribute naming. From today’s perspective, it’s too easy to say “take this legacy stuff out”. But, the app’s been around for >20 years, originally action code didn’t use the $-prefix, and yanking such support would just ruin the day of long-standing (paying!) Tinderbox users.
A really interesting support case that had me stumped and ‘chapeau’ to @eastgate for catching this.
If there is a ‘lesson learned’ from this, it is: don’t make user attributes with ‘names’ that are numbers, e.g. ‘5’, and if you do make the default the same as the name-number. Taking the latter into account, I think this means, friends don’t let friends make user attribute whose names are literal numbers.
But, this is a real and odd edge case. No one, user or app did anything stupid or wrong. It shows that the easy “why doesn’t it ‘just’ work?” reaction that we all have can un-pick some odd confluences.