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
This post has been closed. You can still view previous posts, but you can't post any new replies.

Bug Fix Repeating Section Sheetworkers now on Dev Server

1637606478

Edited 1637606900
Nicholas
Roll20 Team
Hi everyone, We’ve just posted a sheetworkers bug fix to the dev server for testing and would love for you to check it out. Essentially, the problem was that on() event listeners were not selecting the correct attributes of repeating sections when passed in as the arguments of the listener. Also, the parent repeating section scope itself should be available in that same event. On the dev server, t he following code should now trigger both the parent repeating_test section and the receiver_1 attribute child of the repeating section. <fieldset class='repeating_test'>     <input type='text' name='attr_receiver_1' value=''>     <input type='text' name='attr_receiver_2' value=''>     <input type='text' name='attr_receiver_3' value=''>     <input type='text' name='attr_receiver_4' value=''> </fieldset> <script type='text/worker'>     on('change:repeating_test:receiver_1', (event)=>{         console.table(event);     }); </script> As you take a look at this on the dev server , we would ask that you please check to see that this bug has been fixed, but also that other sheetworkers for your sheets are working as intended and no other adverse effects are found. If you do find anything strange with sheetworkers or repeating sections, please let us know in the thread. Thanks!
1637615297
vÍnce
Pro
Sheet Author
Thanks Nic.  As a programming neophyte, I have probably been caught by this bug and just assumed I was doing something wrong. ;-(   So what were sheetworkers actually using in the repeating section to trigger?   and I have to ask... any idea how long this has been broken for live sheets? Thanks
Hey vÍnce! Essentially, the problem was that in certain workflows, the event was triggering for every child attribute in the repeating section, not just the specific attribute you passed in as the argument. So the above example code was triggering for receiver_1, but also for receiver_2, receiver_3, etc. At this point, we don't have an estimate for how long that has been ongoing unfortunately.
1638215819
vÍnce
Pro
Sheet Author
I can see how that could be problematic.  I suppose I should include more logging in my code to catch these kind of things.  Thanks for the followup Nicholas.
1638223617
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Hey Nic, So, this fix seems to have disabled the ability for the below code to detect a change in a repeating section: <fieldset class='repeating_test'>     <input type='text' name='attr_receiver_1' value=''>     <input type='text' name='attr_receiver_2' value=''>     <input type='text' name='attr_receiver_3' value=''>     <input type='text' name='attr_receiver_4' value=''> </fieldset> <script type='text/worker'>     on('change:receiver_1', (event)=>{         console.table(event);     }); </script> Is that the intended change?
Hey folks! Quick update - When we worked on this, we actually missed the original use case this was trying to address, which is the code supplied above by Scott C and seen here: <fieldset class='repeating_test'> <input type='text' name='attr_receiver_1' value=''> <input type='text' name='attr_receiver_2' value=''> <input type='text' name='attr_receiver_3' value=''> <input type='text' name='attr_receiver_4' value=''> </fieldset> <script type='text/worker'> on('change:receiver_1', (event)=>{ console.table(event); }); </script> Also, after investigation, it actually looks like the following code that I originally mentioned is working as intended on production and is not actually a bug: <fieldset class='repeating_test'> <input type='text' name='attr_receiver_1' value=''> <input type='text' name='attr_receiver_2' value=''> <input type='text' name='attr_receiver_3' value=''> <input type='text' name='attr_receiver_4' value=''> </fieldset> <script type='text/worker'> on('change:repeating_test:receiver_1', (event)=>{ console.table(event); }); </script> Solving the first use case mentioned above is going to require some additional thoughts and planning, so we are going to shelf this work for now and close this post. Apologies for any confusion or inconvenience here!