Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Incorrect change events firing for sheet workers

1458375447
Lucian
Pro
API Scripter
I'm aware that as part of the spec for sheet workers, the namespace for all attributes, repeating or not, is effectively flattened, so on update of a field 'repeating_action_IDXYZ_damage_toggle'  we should expect to receive events for 'repeating_action',  'repeating_action:damage_toggle' and 'damage_toggle'.  However, in some circumstances, I'm now seeing 'change:repeating_action' with a sourceAttribute of 'repeating_action_damage_toggle' (note the lack of ID in the middle). This is exceptionally unhelpful because that sourceAttribute does not (and cannot) exist - attempts to set an attribute with that name produce an error; it's particularly frustrating because there is no good way to distinguish in code between these events and a change event for a field under 'repeating_action' called 'toggle'  that has an ID of 'damage'. Is this some sort of undocumented additional event (in which case, is there an unwritten rule that underscores are not allowed in attribute names?) or is this a bug in the event firing system? Either way, some clarity is needed urgently because it's breaking sheet workers.
Do you have a simplified test case that shows this happening? Having underscores inside of the name of the attribute should be fine (as long as it's in the attribute name and not the section name).
1458671894
Lucian
Pro
API Scripter
Hey Riley, I'm afraid I haven't had time to produce one yet, and I probably won't for a week or so  (I'm away at the moment). You could try opening the Reshaped Sheet with some logging of which events were triggering. That should show you it happening - it was happening pretty reliably for me the other day. That said, i think I was largely working with sheet:opened at that point, so it's possible that this behaviour is somehow connected to my other bug? Failing that I will try and produce a test case for you when I get back. Cheers, Lucian