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

Repeating Fields Issues: Pathfinder Sheet

January 12 (9 years ago)
Riley D.
Roll20 Team
If you are using the Pathfinder sheet and you are having issues with your repeating fields, please post in this thread. Provide a link to the Game Details page of your game, as well as a list of steps we can do to see the problem happening (e.g. "Add a new row, then delete it, then change this, etc.").

We'll address each game individually until we either fix all the games or figure out the underlying issue. Thanks!
January 12 (9 years ago)
vÍnce
Pro
Sheet Author
I just wanted to report back that the test case that I had for Pathfinder is now working as expected!  And I know of at least one other user with similar repating section problems that have reported the issue resolved for them as well.
Thanks for your help guys.
January 13 (9 years ago)

Edited January 13 (9 years ago)
Link

Create a brand new character sheet and go to the NPC tab, enter 18 into the Strength field, tab through the all the stat fields on that line including the BAB field. By the time I fill in BAB it usually freezes just for a second and then creates the repeating fields.

My players have issues as well, and it's always when the math is being calculated for attacks, but I don't know exactly how to recreate their issues.

At one time I thought it was my computer, which is a bit oldish, but it happened to my player with a brand new self built gaming PC. I don't think it's my connection either, it's 100 Mbps up and down.

Thank you for the help on this, I appreciate the fact that you guys are taking the time and making the effort to help.
January 13 (9 years ago)
Stephen Koontz
Forum Champion
Marketplace Creator
Sheet Author
API Scripter
Compendium Curator

Larry K. said:

Link

Create a brand new character sheet and go to the NPC tab, enter 18 into the Strength field, tab through the all the stat fields on that line including the BAB field. By the time I fill in BAB it usually freezes just for a second and then creates the repeating fields.

My players have issues as well, and it's always when the math is being calculated for attacks, but I don't know exactly how to recreate their issues.

At one time I thought it was my computer, which is a bit oldish, but it happened to my player with a brand new self built gaming PC. I don't think it's my connection either, it's 100 Mbps up and down.

Thank you for the help on this, I appreciate the fact that you guys are taking the time and making the effort to help.

Just so we're on the same page, you mean tab through the quick stats section? Which repeating sections are you seeing generated? Could you provide a screen shot? What's your OSX and Browser version?
January 13 (9 years ago)

Edited January 13 (9 years ago)
Yes, the quick stats section at the top.

Attacks, the one for the following screen shot created 17 blank attacks.

Image

Windows 7 & Chrome - Version 47.0.2526.106 m

It didn't create the fields the first time I tried but it did the second. I was also able to cause blank repeating attacks to be created on my player's sheets by checking 2-4 buffs (filled out with numbers) and a condition box on the core tab. I deleted the empty attacks and then when I unchecked the conditions and buffs it created them again.

At times, when it is recalculating the numbers for attacks in the background, it freezes on me, and when it does, it creates X number of empty repeating attacks.

January 13 (9 years ago)

Edited January 17 (9 years ago)
chris b.
Pro
Sheet Author
API Scripter
I saw it on the dev server yesterday and will try to recreate it. I added a spell to the repeating_lvl-0-spells section, there were 2 already, but the 3rd I added was displayed in the 2nd position. BUT, if you called getSectionIds they were still returned in the order they were created. So getSectionIds returned 0,1,2 but they were displayed in the order 0, 2, 1
When I closed the browser and re-opened it, they were displayed correctly in the order created: 0,1,2
If i can make it happen again i'll  paste the logs, 


January 13 (9 years ago)
Stephen Koontz
Forum Champion
Marketplace Creator
Sheet Author
API Scripter
Compendium Curator

Larry K. said:

Yes, the quick stats section at the top.

Attacks, the one for the following screen shot created 17 blank attacks.

Image

Windows 7 & Chrome - Version 47.0.2526.106 m

It didn't create the fields the first time I tried but it did the second. I was also able to cause blank repeating attacks to be created on my player's sheets by checking 2-4 buffs (filled out with numbers) and a condition box on the core tab. I deleted the empty attacks and then when I unchecked the conditions and buffs it created them again.

At times, when it is recalculating the numbers for attacks in the background, it freezes on me, and when it does, it creates X number of empty repeating attacks.

What's the name of the game you're seeing this in, Larry?

RotR: Sins of the Saviors

I can give an invite if necessary.
January 13 (9 years ago)
Stephen Koontz
Forum Champion
Marketplace Creator
Sheet Author
API Scripter
Compendium Curator
Larry, I checked out the game and I'm seeing the old issue of lowercase IDs on the repeating section which has since been solved. I tried to replicate the issue and couldn't. If you clear your cache are you still have that issue on a new character?
New characters no longer have issues. Is there something I can do for the existing sheets?
January 13 (9 years ago)
Stephen Koontz
Forum Champion
Marketplace Creator
Sheet Author
API Scripter
Compendium Curator
Is it an issue for you to just delete the bad repeating sections outlined in red?
January 13 (9 years ago)

Edited January 13 (9 years ago)
It won't be a problem for my NPC sheets and I'll recreate the PC sheets so they don't have to deal with the issue every time we play.

Thanks for the help.
January 17 (9 years ago)
vÍnce
Pro
Sheet Author
We had another PF user that still had repeating attacks being added to their sheet when adjusting STR, so I check my test case and it's having similar issues again.
If I toggle a melee buff, a new attack gets added.  As long as I don't remove this last row, it doesn't add anymore.  But if I delete the row and toggle melee buff, a new attack row gets added again.  It appears I can also toggle the attack type from melee to none, if I leave the tab and come back, a new attack row is added.  Not sure what's going on.   ;-(

test case: https://app.roll20.net/join/1183314/00Gw_A

January 17 (9 years ago)

Edited January 17 (9 years ago)
chris b.
Pro
Sheet Author
API Scripter
Could the fact some repeating sections appear twice have an effect? Some are repeated on the NPC tab with the same names, like repeating_weapon  etc. Before the update all the two  meant was one was a copy of the other section. 
January 17 (9 years ago)

Edited January 17 (9 years ago)
vÍnce
Pro
Sheet Author

chris b. said:

Could the fact some repeating sections appear twice have an effect? Some are repeated on the NPC tab with the same names, like repeating_weapon  etc. Before the update all the two  meant was one was a copy of the other section. 
I think you may be onto something.  I'm not sure why it would add a new repeating section though...  That would make more sense in explaining the duplicate attribute bug that we're seeing.  However, I have seen duplicates for some attributes that only exist on the PC side of the sheet, like buffs.
January 18 (9 years ago)

Vince said:

chris b. said:

Could the fact some repeating sections appear twice have an effect? Some are repeated on the NPC tab with the same names, like repeating_weapon  etc. Before the update all the two  meant was one was a copy of the other section. 
I think you may be onto something.  I'm not sure why it would add a new repeating section though...  That would make more sense in explaining the duplicate attribute bug that we're seeing.  However, I have seen duplicates for some attributes that only exist on the PC side of the sheet, like buffs.

I have written a script that goes through the attributes and deletes any duplicate attributes where both the attribute name and the attribute value are the same. The script will also help you go through and merge attributes that are duplicated by name, but have different values. You will be asked what value to use for each attribute that has a conflict.

I have posted the script in another thread: https://app.roll20.net/forum/post/2830146/slug%7D
January 18 (9 years ago)
vÍnce
Pro
Sheet Author

Paul T. said:

Vince said:

chris b. said:

Could the fact some repeating sections appear twice have an effect? Some are repeated on the NPC tab with the same names, like repeating_weapon  etc. Before the update all the two  meant was one was a copy of the other section. 
I think you may be onto something.  I'm not sure why it would add a new repeating section though...  That would make more sense in explaining the duplicate attribute bug that we're seeing.  However, I have seen duplicates for some attributes that only exist on the PC side of the sheet, like buffs.

I have written a script that goes through the attributes and deletes any duplicate attributes where both the attribute name and the attribute value are the same. The script will also help you go through and merge attributes that are duplicated by name, but have different values. You will be asked what value to use for each attribute that has a conflict.

I have posted the script in another thread: https://app.roll20.net/forum/post/2830146/slug%7D
Thanks for the work Paul.  It's too bad you can't determine which value was the most recent and only save that attribute and value...

January 18 (9 years ago)

Edited January 18 (9 years ago)
Riley D.
Roll20 Team
The multiple uses of the same repeating section shouldn't make a difference, I don't think. As long as whatever shows up in one is exactly what you want showing up in another. 

I just made a copy of your test case and wasn't able to reproduce, Vince, but it might be because of the fixes I've rolled out this morning. Can you take another look and see if you're still able to reproduce? If so let me know.

However, I did notice a couple of odd things as I was playing around with the Pathfinder sheet this morning:

1) Even if I manually hit the "Re-Calc" button, the sheet version doesn't seem to increase to 0.19 unless I do certain things (such as adding an Attack). So just changing the base stats like STR and DEX and having those mods get calculated didn't increase the version number. Just wanted to make sure that's working as intended.

2) I noticed that when I toggle the various Buffs on the Core screen, the Total along the bottom (e.g. "buff_total-Melee") isn't actually updating unless I do a manual ReCalc using the toggle. Then it updates. 

Just a heads up, I'm not a regular user of the sheet and I haven't read all the posts on it, so if that's normal then that's fine, but just seemed off to me so I thought I would point those things out.

In addition, note that I don't think that this bug had anything to do with duplicate attributes, I think they were/are two separate issues.

Thanks!
January 18 (9 years ago)
vÍnce
Pro
Sheet Author
Thanks Riley.  It's no longer creating the extra attack row, so whatever was done on the server must have fixed that.  In regards to the recalc not changing and buffs not totaling... I believe that was working before, so I'll need to investigate.  We have v20 in beta and I'll check to see if a new v20 fails as well.  Thank you for the time.
January 18 (9 years ago)
vÍnce
Pro
Sheet Author
OK.  v20 seems to handle recalc (a new character is set to v.20 upon opening for the first time) so I believe that is working.  However the buffs total row is not calculating without a manual recalc.  I'll pass this onto Chris so he can have a look in the sheet workers and figure out the bug.  Thanks
January 26 (9 years ago)

Edited January 26 (9 years ago)
chris b.
Pro
Sheet Author
API Scripter
Ok, here we have a repeatable error. When you modify the STR-mod (strength modifier), it creates 3 rows of repeating fields. Sometimes the first row is outlined in red, sometimes not. The 2nd and 3rd are never outlined in red, but ALL are invalid.

Here is the GIST Of our code: https://gist.github.com/plutosdad/b084fafe88f8eeb1...
(after saving the gist above to a campaign)

Test:  STR  
1. Create new character.
2. verify it says .20 in version at upper right.
3. go to Attacks tab , verify there are no attacks (at the very bottom of the page)
4. go to Core tab, go to STR-base (or anything on the Strength line) and modify it , tab out of field to commit
5. go to Attacks tab, verifty there are 3 attacks..
6. check console log for string: ERROR: ... invalid id: and view the id number. This is a number that is returned by getSectionIds. sometimes it is null, sometimes it is the name of a field the system is firing a change event on. (so there are 3, null, "attack-type", and "damage-ability" because those are the 2 fields it loops through getSectionIDs and attempts to update)



test 2: DEX
purpose: baseline
1. create new character
2. change DEX 
3. note no new attacks

test 3: DEX to Melee  
purpose: (change @{melee-ability} to @{DEX-mod} and watch how it affects repeating rows
1.create new character
2. go to Attacks tab
3. on Melee dropdown near top, change STR to DEX
4. go to Core
5. update DEX to a different value
6. go to Attacks tab, verify there are now TWO attacks, (Melee is the default, by assigning DEX to melee, we are triggering a change. Even if there are no rows, something is creating those rows)

This happens because: (@{STR-mod} is default for @{melee-ability} and @{repeating_weapon_$X_damage-ability} and @{melee-ability} causes update to @{attk-melee} and @{attk-melee} is default for @{repeating_weapon_$X_attack-type} . So changing STR-mod causes cascade. but if no rows are in repeating_weapon, the sheet is just adding rows)
But in the 3rd test, when we assign DEX-mod to melee-ability, then update DEX-mod, we cause a cascading change to repeating_weapon_attack-type, but NOT to repeating_weapon_damage-ability, so only 2 rows are created instead of 3. 

Particulars:
1. in every repeating_weapon there are two select dropdowns, the options values reference fields on the sheet. when we used autocalculated fields these were used as the value. But now that we use sheetworkers, these old values are kept for backward compatibility, plus, since the value is the reference of a field, we notice that it calls the onchange event for the select, within the context of a repeating item.
Here are the important fields:
the melee-ability  select event calls handleDropdown() which updates melee-ability-mod. Every select is sent to either handledropdown(), handleRepeatingAttackDropdown(), or handleRepeatingDamageDropdown().  they all modify a field with the same attribute name as the select, but with a "-mod" at the end.
<!-- core tab -->
<input  type="number" name="attr_STR" readonly="readonly" /> <input  type="number" name="attr_STR-mod" readonly="readonly" /> <input  type="number" name="attr_STR-base"  /> <!-- USER ENTERS HERE --> <input  type="number" name="attr_DEX" readonly="readonly" /> <input  type="number" name="attr_DEX-mod" readonly="readonly" /> <input  type="number" name="attr_DEX-base"  /> <!-- USER ENTERS HERE --> <!-- attacks tab top box --> <input type="number" name="attr_attk-melee" readonly="readonly" /> <select name="attr_melee-ability" > <option value="0"  >None</option> <option value="@{STR-mod}" selected>•STR</option> <option value="@{DEX-mod}">DEX</option> <option value="@{CON-mod}">CON</option> <option value="@{INT-mod}">INT</option> <option value="@{WIS-mod}">WIS</option> <option value="@{CHA-mod}">CHA</option> </select> <input type="number" name="attr_melee-ability" readonly="readonly" />
<!-- attacks tab, repeating_weapon at bottom of page -->
<fieldset class="repeating_weapon">
    <select name="attr_attack-type">         <option value="@{attk-melee}" selected >Melee</option>         <option value="@{attk-ranged}">Ranged</option>         <option value="@{CMB}">CMB</option>     </select>     <input type="number" name="attr_attack-type-mod" readonly="readonly"  />     <select  name="attr_damage-ability" >         <option value="0">None</option>         <option value="@{STR-mod}" selected>•STR</option> <!-- a lot more options but I simplified for this post -->         <option value="@{DEX-mod}">DEX</option>         <option value="@{CON-mod}">CON</option>         <option value="@{INT-mod}">INT</option>         <option value="@{WIS-mod}">WIS</option>         <option value="@{CHA-mod}">CHA</option>     </select>     <input type="number" name="attr_damage-ability-mod" readonly="readonly" />
<input type="hidden" name="attr_new_flag" value="0"  />
<input type="number" name="attr_row_index" value="0" readonly="readonly" /> <input type="text" name="attr_row_id" value="" readonly="readonly" /> </fieldset>

2. similar dropdowns set Strength as the default attribute to use in Melee, resulting in a cascading change so that when Strength is modified then @{melee} is and so is each attack in the repeating_weapon

As long as you have one valid row in repeating_weapon, it works. But if you don't , then the sheet creates 2 or 3 new rows (3 if you modify STR, 2 if you modify anything else assigned to Melee which is the default). this is because Melee is the default choice for repeating_weapon_attack_type, and STR is the default choice for repeating_weapon_damage-ability

3.recent changes:
3.a. defaults for @{repeating_weapon_$X_attack-type} was changed to @{attk-melee} and default for @{repeating_wewapon_$X_damage-ability} was changed to @{STR-mod} , to help users not have to keep picking the same fields. I think this is what started the addition of blank rows if no rows existed yet. Before the defaults were <option value="0" >None</option>
we added the following in order to debug past repeating item problems:
3.b. "new_flag" attribute,  so we know if it is new or not. If we receive a change to repeating_(whatever)_new_flag. We check this flag, if it is not set, then we know this is new ( except for the one change the user made, normally, since it cannot be fired unless the user changes something in the row).  This check is made in the checkIsNewRow() function, which fires within the context of a repeating weapon ( on("change:repeating_weapon" ))
3.c. ID and Index, which we get from getSectionIDs. these are added to each repeating item if the new_flag is not set. This is done in the setRepeatingRowDefaultFields() function.
3.d. When we check for the new_flag and we are at a weapon, force write attributes for the dropdowns attack-type and damage-ability (it looks at the selected option in attack-type, and then writes the resultant value in attack-type-mod. Same for damage-ability and damage-ability-mod. This check  (are we new and are we a weapon) is made in checkIsNewRow(), and it calls handleRepeatingAttackDropdown() and handleRepeatingDamageDropdown() 

4. ALL of the functions in 3  call  isBadRowId(). If the id is bad then write an error message, and stop processing that row, DO NOT UPDATE ANYTHING, even the index and ID
Definition of bad; null / blank returned by getSectionIds, or the name of ID equal to name of the repeating section ("weapon" in this case) ,  or equal to the name of the field that is triggering the event: in our case it is "attack-type" and "damage-ability" so I have found 4 invalid IDs returned by getSectionIds.:


SO, ... it is creating new rows , with ids of blank, attack-type, damage-ability


Here is the log:
My additions are: if the row begins with:
CHRIS: I added this after taking the log to tell you what step I was on.
TRACE: written at the beginning of a function that affects / is affected by the above scenarios
DEBUG: other stuff to write to check values
TRACE: EVENT: when on("change: .... ") fires, write the change detected to the log, before calling a function.


Connected to session
Someone just connected.
It's us?
Render character editor
Do refresh link cache!
Refresh Journal List!
Search took 22ms
--- RENDER CHARACTIVE VIEW ----


CHRIS: CREATE NEW CHARACTER 




CLICKED
Redoing charsheet html
238ms to end of html
Triggering for sheet:opened
TRACE: checkUpdate
Mixed Content: The page at 'https://app.roll20dev.net/editor/' was loaded over HTTPS, but requested an insecure image 'http://imgsrv.roll20.net/?src=paizo.com/image/content/Logos/PathfinderRPGLogo_500.jpeg'. This content should also be served over HTTPS.
DEBUG: checkUpdate Current Pathfinder sheet data version:0, Sheet code version:0.2


CHRIS: TONS OF LOGS REMOVED SINCE RECALC ALL IS CALLED AND VERSION UPDATED TO .20


Took 806ms


CHRIS: UPDATE STR-BASE FIELD
CHRIS: THIS IS MY LAST COMMENT THE REST OF LOG IS WHAT HAPPENS NEXT


Updating character sheet values
Really updating character sheet values
Setting up repeating sections took until 36ms
Finding list of dirty attributes took until 37ms
Triggering for change:str-base
TRACE:updateAbility ability:STR
Triggering for change:str-base_max
Querytest took until 44ms
Set values took until 52ms
Took 62ms
Updating character sheet values
Really updating character sheet values
Setting up repeating sections took until 14ms
Finding list of dirty attributes took until 20ms
Triggering for change:str
Triggering for change:str_max
Triggering for change:str-mod
Triggering for change:str-mod_max
Triggering for change:cmd-ability1
Triggering for change:melee-ability
TRACE: EVENT change:melee-ability
Triggering for change:cmb-ability
TRACE: EVENT change:cmb-ability
Triggering for change:repeating_weapon
TRACE: At checkIsNewRow for section weapon
Triggering for change:attack-show
Triggering for change:attack-roll
Triggering for change:enhance
Triggering for change:masterwork
Triggering for change:name
Triggering for change:attack
Triggering for change:attack-mod
Triggering for change:attack-type
Triggering for change:attack-type-mod
Triggering for change:attk-effect-total-copy
Triggering for change:total-attack
Triggering for change:crit-target
Triggering for change:crit-multiplier
Triggering for change:proficiency
Triggering for change:damage-dice-num
Triggering for change:damage-die
Triggering for change:damage
Triggering for change:damage-mod
Triggering for change:damage-ability
Triggering for change:damage-ability-max
Triggering for change:damage-ability-mod
Triggering for change:dmg-effect-total-copy
Triggering for change:dmg-mod-copy
Triggering for change:total-damage
Triggering for change:range
Triggering for change:type
Triggering for change:weight
Triggering for change:ammo
Triggering for change:notes
Triggering for change:iterative-attacks-show
Triggering for change:options-show
Triggering for change:macro-text-show
Triggering for change:ids-show
Triggering for change:toggle_iterative_attack2
Querytest took until 25ms
Triggering for change:iterative_attack2_value
Triggering for change:var_iterative_attack2_macro
Triggering for change:var_iterative_attack2
Triggering for change:toggle_iterative_attack3
Triggering for change:iterative_attack3_value
Triggering for change:var_iterative_attack3_macro
Triggering for change:var_iterative_attack3
Triggering for change:toggle_iterative_attack4
Triggering for change:iterative_attack4_value
Triggering for change:var_iterative_attack4_macro
Triggering for change:var_iterative_attack4
Triggering for change:toggle_iterative_attack5
Triggering for change:iterative_attack5_value
Triggering for change:var_iterative_attack5_macro
Triggering for change:var_iterative_attack5
Triggering for change:toggle_iterative_attack6
Triggering for change:iterative_attack6_value
Triggering for change:var_iterative_attack6_macro
Triggering for change:var_iterative_attack6
Triggering for change:toggle_iterative_attack7
Triggering for change:iterative_attack7_value
Triggering for change:var_iterative_attack7_macro
Triggering for change:var_iterative_attack7
Triggering for change:toggle_iterative_attack8
Triggering for change:iterative_attack8_value
Triggering for change:var_iterative_attack8_macro
Triggering for change:var_iterative_attack8
Triggering for change:iterative_attacks
Triggering for change:var_melee_notes
Triggering for change:var_ranged_notes
Triggering for change:var_cmb_notes
Triggering for change:var_none_notes
Triggering for change:var_attack_notes
Triggering for change:toggle_notes
Triggering for change:toggle_attack_notes
Triggering for change:macro_options
Triggering for change:macro-text
Triggering for change:new_flag
Triggering for change:row_index
Triggering for change:row_id
Triggering for change:attack-npc-roll
Triggering for change:climb-ability
Triggering for change:climb-ability-mod
Triggering for change:swim-ability
Triggering for change:swim-ability-mod
Triggering for change:cs-athletics-ability
Triggering for change:cs-athletics-ability-mod
Set values took until 73ms
Took 82ms
TRACE:handleRepeatingRowOrdering section:weapon
DEBUG: this is a NEW REPEATING_WEAPON set attack and damage dropdowns 
TRACE:handleRepeatingAttackDropdown id:undefined
TRACE: isBadRowId section:weapon, id:undefined, null ok?:true
DEBUG: GOOD ID:undefined for section weapon
TRACE:handleRepeatingDamageDropdown id:undefined
TRACE: isBadRowId section:weapon, id:undefined, null ok?:true
DEBUG: GOOD ID:undefined for section weapon
Updating character sheet values
Really updating character sheet values
Setting up repeating sections took until 81ms
Finding list of dirty attributes took until 96ms
Triggering for change:cmd-str
Triggering for change:cmd-str_max
Triggering for change:melee-ability-mod
TRACE: EVENT change:melee-ability-mod
TRACE:updateAttack attype:melee
Triggering for change:melee-ability-mod_max
Triggering for change:cmb-ability-mod
TRACE: EVENT change:cmb-ability-mod
TRACE:updateAttack attype:CMB
Triggering for change:cmb-ability-mod_max
Triggering for change:repeating_weapon
TRACE: At checkIsNewRow for section weapon
Triggering for change:repeating_weapon:attack-type-mod
TRACE: EVENT change:repeating_weapon:attack-type-mod
TRACE:updateRepeatingWeaponAttack id:undefined
TRACE: isBadRowId section:weapon, id:undefined, null ok?:true
DEBUG: GOOD ID:undefined for section weapon
Triggering for change:repeating_weapon:attack-type-mod_max
Triggering for change:repeating_weapon
TRACE: At checkIsNewRow for section weapon
Triggering for change:repeating_weapon:damage-ability-mod
TRACE: EVENT change:repeating_weapon:damage-ability-mod
TRACE:updateRepeatingWeaponDamage id:undefined
TRACE: isBadRowId section:weapon, id:undefined, null ok?:true
DEBUG: GOOD ID:undefined for section weapon
Triggering for change:repeating_weapon:damage-ability-mod_max
Triggering for change:climb-ability-mod
Triggering for change:climb-ability-mod_max
Triggering for change:swim-ability-mod
Querytest took until 103ms
Triggering for change:swim-ability-mod_max
Triggering for change:cs-athletics-ability-mod
Triggering for change:cs-athletics-ability-mod_max
Triggering for change:attack-show
Triggering for change:attack-roll
Triggering for change:enhance
Triggering for change:masterwork
Triggering for change:name
Triggering for change:attack
Triggering for change:attack-mod
Triggering for change:attack-type
Triggering for change:attack-type-mod
Triggering for change:attk-effect-total-copy
Triggering for change:total-attack
Triggering for change:crit-target
Triggering for change:crit-multiplier
Triggering for change:proficiency
Triggering for change:damage-dice-num
Triggering for change:damage-die
Triggering for change:damage
Triggering for change:damage-mod
Triggering for change:damage-ability
Triggering for change:damage-ability-max
Triggering for change:damage-ability-mod
Triggering for change:dmg-effect-total-copy
Triggering for change:dmg-mod-copy
Triggering for change:total-damage
Triggering for change:range
Triggering for change:type
Triggering for change:weight
Triggering for change:ammo
Triggering for change:notes
Triggering for change:iterative-attacks-show
Triggering for change:options-show
Triggering for change:macro-text-show
Triggering for change:ids-show
Triggering for change:toggle_iterative_attack2
Triggering for change:iterative_attack2_value
Triggering for change:var_iterative_attack2_macro
Triggering for change:var_iterative_attack2
Triggering for change:toggle_iterative_attack3
Triggering for change:iterative_attack3_value
Triggering for change:var_iterative_attack3_macro
Triggering for change:var_iterative_attack3
Triggering for change:toggle_iterative_attack4
Triggering for change:iterative_attack4_value
Triggering for change:var_iterative_attack4_macro
Triggering for change:var_iterative_attack4
Triggering for change:toggle_iterative_attack5
Triggering for change:iterative_attack5_value
Triggering for change:var_iterative_attack5_macro
Triggering for change:var_iterative_attack5
Triggering for change:toggle_iterative_attack6
Triggering for change:iterative_attack6_value
Triggering for change:var_iterative_attack6_macro
Triggering for change:var_iterative_attack6
Triggering for change:toggle_iterative_attack7
Triggering for change:iterative_attack7_value
Triggering for change:var_iterative_attack7_macro
Triggering for change:var_iterative_attack7
Triggering for change:toggle_iterative_attack8
Triggering for change:iterative_attack8_value
Triggering for change:var_iterative_attack8_macro
Triggering for change:var_iterative_attack8
Triggering for change:iterative_attacks
Triggering for change:var_melee_notes
Triggering for change:var_ranged_notes
Triggering for change:var_cmb_notes
Triggering for change:var_none_notes
Triggering for change:var_attack_notes
Triggering for change:toggle_notes
Triggering for change:toggle_attack_notes
Triggering for change:macro_options
Triggering for change:macro-text
Triggering for change:new_flag
Triggering for change:row_index
Triggering for change:row_id
Triggering for change:attack-npc-roll
Set values took until 212ms
Took 219ms
TRACE:handleRepeatingRowOrdering section:weapon
DEBUG: this is a NEW REPEATING_WEAPON set attack and damage dropdowns 
TRACE:handleRepeatingAttackDropdown id:undefined
TRACE: isBadRowId section:weapon, id:undefined, null ok?:true
DEBUG: GOOD ID:undefined for section weapon
TRACE:handleRepeatingDamageDropdown id:undefined
TRACE: isBadRowId section:weapon, id:undefined, null ok?:true
DEBUG: GOOD ID:undefined for section weapon
TRACE:handleRepeatingRowOrdering section:weapon
DEBUG: this is a NEW REPEATING_WEAPON set attack and damage dropdowns 
TRACE:handleRepeatingAttackDropdown id:undefined
TRACE: isBadRowId section:weapon, id:undefined, null ok?:true
DEBUG: GOOD ID:undefined for section weapon
TRACE:handleRepeatingDamageDropdown id:undefined
TRACE: isBadRowId section:weapon, id:undefined, null ok?:true
DEBUG: GOOD ID:undefined for section weapon
TRACE: isBadRowId section:weapon, id:, null ok?:false
ERROR: handleRepeatingRowOrdering invalid id:
TRACE: isBadRowId section:weapon, id:damage-ability, null ok?:false
ERROR: handleRepeatingRowOrdering invalid id:damage-ability
TRACE: isBadRowId section:weapon, id:, null ok?:false
ERROR: handleRepeatingRowOrdering invalid id:
TRACE: isBadRowId section:weapon, id:damage-ability, null ok?:false
ERROR: handleRepeatingRowOrdering invalid id:damage-ability
Updating character sheet values
Really updating character sheet values
Setting up repeating sections took until 16ms
Finding list of dirty attributes took until 43ms
Triggering for change:cmd
Triggering for change:cmd_max
Triggering for change:ff-cmd
Triggering for change:ff-cmd_max
Triggering for change:attk-melee
Triggering for change:attk-melee_max
Triggering for change:cmb
TRACE: EVENT change:CMB
Triggering for change:cmb_max
Triggering for change:climb
Triggering for change:climb_max
Triggering for change:swim
Triggering for change:swim_max
Triggering for change:cs-athletics
Triggering for change:cs-athletics_max
Triggering for change:repeating_weapon
TRACE: At checkIsNewRow for section weapon
Triggering for change:repeating_weapon:total-attack
Triggering for change:repeating_weapon:total-attack_max
Triggering for change:repeating_weapon
TRACE: At checkIsNewRow for section weapon
Querytest took until 47ms
Triggering for change:repeating_weapon:total-damage
Triggering for change:repeating_weapon:total-damage_max
Triggering for change:repeating_weapon:damage-ability-mod
TRACE: EVENT change:repeating_weapon:damage-ability-mod
TRACE:updateRepeatingWeaponDamage id:undefined
TRACE: isBadRowId section:weapon, id:undefined, null ok?:true
DEBUG: GOOD ID:undefined for section weapon
Triggering for change:repeating_weapon:damage-ability-mod_max
Triggering for change:repeating_weapon
TRACE: At checkIsNewRow for section weapon
Triggering for change:attack-show
Triggering for change:attack-roll
Triggering for change:enhance
Triggering for change:masterwork
Triggering for change:name
Triggering for change:attack
Triggering for change:attack-mod
Triggering for change:attack-type
Triggering for change:attack-type-mod
Triggering for change:attk-effect-total-copy
Triggering for change:total-attack
Triggering for change:crit-target
Triggering for change:crit-multiplier
Triggering for change:proficiency
Triggering for change:damage-dice-num
Triggering for change:damage-die
Triggering for change:damage
Triggering for change:damage-mod
Triggering for change:damage-ability
Triggering for change:damage-ability-max
Triggering for change:damage-ability-mod
Triggering for change:dmg-effect-total-copy
Triggering for change:dmg-mod-copy
Triggering for change:total-damage
Triggering for change:range
Triggering for change:type
Triggering for change:weight
Triggering for change:ammo
Triggering for change:notes
Triggering for change:iterative-attacks-show
Triggering for change:options-show
Triggering for change:macro-text-show
Triggering for change:ids-show
Triggering for change:toggle_iterative_attack2
Triggering for change:iterative_attack2_value
Triggering for change:var_iterative_attack2_macro
Triggering for change:var_iterative_attack2
Triggering for change:toggle_iterative_attack3
Triggering for change:iterative_attack3_value
Triggering for change:var_iterative_attack3_macro
Triggering for change:var_iterative_attack3
Triggering for change:toggle_iterative_attack4
Triggering for change:iterative_attack4_value
Triggering for change:var_iterative_attack4_macro
Triggering for change:var_iterative_attack4
Triggering for change:toggle_iterative_attack5
Triggering for change:iterative_attack5_value
Triggering for change:var_iterative_attack5_macro
Triggering for change:var_iterative_attack5
Triggering for change:toggle_iterative_attack6
Triggering for change:iterative_attack6_value
Triggering for change:var_iterative_attack6_macro
Triggering for change:var_iterative_attack6
Triggering for change:toggle_iterative_attack7
Triggering for change:iterative_attack7_value
Triggering for change:var_iterative_attack7_macro
Triggering for change:var_iterative_attack7
Triggering for change:toggle_iterative_attack8
Triggering for change:iterative_attack8_value
Triggering for change:var_iterative_attack8_macro
Triggering for change:var_iterative_attack8
Triggering for change:iterative_attacks
Triggering for change:var_melee_notes
Triggering for change:var_ranged_notes
Triggering for change:var_cmb_notes
Triggering for change:var_none_notes
Triggering for change:var_attack_notes
Triggering for change:toggle_notes
Triggering for change:toggle_attack_notes
Triggering for change:macro_options
Triggering for change:macro-text
Triggering for change:new_flag
Triggering for change:row_index
Triggering for change:row_id
Triggering for change:attack-npc-roll
Triggering for change:climb-macro
Triggering for change:swim-macro
Triggering for change:cs-athletics-macro
Set values took until 169ms
Took 174ms
TRACE:handleRepeatingRowOrdering section:weapon
DEBUG: this is a NEW REPEATING_WEAPON set attack and damage dropdowns 
TRACE:handleRepeatingAttackDropdown id:undefined
TRACE: isBadRowId section:weapon, id:undefined, null ok?:true
DEBUG: GOOD ID:undefined for section weapon
TRACE:handleRepeatingDamageDropdown id:undefined
TRACE: isBadRowId section:weapon, id:undefined, null ok?:true
DEBUG: GOOD ID:undefined for section weapon
TRACE:handleRepeatingRowOrdering section:weapon
DEBUG: this is a NEW REPEATING_WEAPON set attack and damage dropdowns 
TRACE:handleRepeatingAttackDropdown id:undefined
TRACE: isBadRowId section:weapon, id:undefined, null ok?:true
DEBUG: GOOD ID:undefined for section weapon
TRACE:handleRepeatingDamageDropdown id:undefined
TRACE: isBadRowId section:weapon, id:undefined, null ok?:true
DEBUG: GOOD ID:undefined for section weapon
TRACE:handleRepeatingRowOrdering section:weapon
DEBUG: this is a NEW REPEATING_WEAPON set attack and damage dropdowns 
TRACE:handleRepeatingAttackDropdown id:undefined
TRACE: isBadRowId section:weapon, id:undefined, null ok?:true
DEBUG: GOOD ID:undefined for section weapon
TRACE:handleRepeatingDamageDropdown id:undefined
TRACE: isBadRowId section:weapon, id:undefined, null ok?:true
DEBUG: GOOD ID:undefined for section weapon
TRACE: isBadRowId section:weapon, id:, null ok?:false
ERROR: handleRepeatingRowOrdering invalid id:
TRACE: isBadRowId section:weapon, id:damage-ability, null ok?:false
ERROR: handleRepeatingRowOrdering invalid id:damage-ability
TRACE: isBadRowId section:weapon, id:, null ok?:false
ERROR: handleRepeatingRowOrdering invalid id:
TRACE: isBadRowId section:weapon, id:damage-ability, null ok?:false
ERROR: handleRepeatingRowOrdering invalid id:damage-ability
TRACE: isBadRowId section:weapon, id:, null ok?:false
ERROR: handleRepeatingRowOrdering invalid id:
TRACE: isBadRowId section:weapon, id:damage-ability, null ok?:false
ERROR: handleRepeatingRowOrdering invalid id:damage-ability
Updating character sheet values
Really updating character sheet values
Setting up repeating sections took until 55ms
Finding list of dirty attributes took until 69ms
Triggering for change:repeating_weapon
TRACE: At checkIsNewRow for section weapon
Triggering for change:repeating_weapon:total-damage
Triggering for change:repeating_weapon:total-damage_max
Triggering for change:repeating_weapon
TRACE: At checkIsNewRow for section weapon
Triggering for change:repeating_weapon:damage-ability-mod
TRACE: EVENT change:repeating_weapon:damage-ability-mod
TRACE:updateRepeatingWeaponDamage id:undefined
TRACE: isBadRowId section:weapon, id:undefined, null ok?:true
DEBUG: GOOD ID:undefined for section weapon
Triggering for change:repeating_weapon:damage-ability-mod_max
Triggering for change:attack-show
Triggering for change:attack-roll
Triggering for change:enhance
Triggering for change:masterwork
Triggering for change:name
Triggering for change:attack
Triggering for change:attack-mod
Triggering for change:attack-type
Triggering for change:attack-type-mod
Triggering for change:attk-effect-total-copy
Triggering for change:total-attack
Triggering for change:crit-target
Triggering for change:crit-multiplier
Triggering for change:proficiency
Triggering for change:damage-dice-num
Triggering for change:damage-die
Triggering for change:damage
Triggering for change:damage-mod
Triggering for change:damage-ability
Triggering for change:damage-ability-max
Triggering for change:damage-ability-mod
Triggering for change:dmg-effect-total-copy
Triggering for change:dmg-mod-copy
Triggering for change:total-damage
Triggering for change:range
Triggering for change:type
Triggering for change:weight
Triggering for change:ammo
Triggering for change:notes
Triggering for change:iterative-attacks-show
Triggering for change:options-show
Triggering for change:macro-text-show
Triggering for change:ids-show
Triggering for change:toggle_iterative_attack2
Triggering for change:iterative_attack2_value
Triggering for change:var_iterative_attack2_macro
Triggering for change:var_iterative_attack2
Triggering for change:toggle_iterative_attack3
Triggering for change:iterative_attack3_value
Triggering for change:var_iterative_attack3_macro
Querytest took until 76ms
Triggering for change:var_iterative_attack3
Triggering for change:toggle_iterative_attack4
Triggering for change:iterative_attack4_value
Triggering for change:var_iterative_attack4_macro
Triggering for change:var_iterative_attack4
Triggering for change:toggle_iterative_attack5
Triggering for change:iterative_attack5_value
Triggering for change:var_iterative_attack5_macro
Triggering for change:var_iterative_attack5
Triggering for change:toggle_iterative_attack6
Triggering for change:iterative_attack6_value
Triggering for change:var_iterative_attack6_macro
Triggering for change:var_iterative_attack6
Triggering for change:toggle_iterative_attack7
Triggering for change:iterative_attack7_value
Triggering for change:var_iterative_attack7_macro
Triggering for change:var_iterative_attack7
Triggering for change:toggle_iterative_attack8
Triggering for change:iterative_attack8_value
Triggering for change:var_iterative_attack8_macro
Triggering for change:var_iterative_attack8
Triggering for change:iterative_attacks
Triggering for change:var_melee_notes
Triggering for change:var_ranged_notes
Triggering for change:var_cmb_notes
Triggering for change:var_none_notes
Triggering for change:var_attack_notes
Triggering for change:toggle_notes
Triggering for change:toggle_attack_notes
Triggering for change:macro_options
Triggering for change:macro-text
Triggering for change:new_flag
Triggering for change:row_index
Triggering for change:row_id
Triggering for change:attack-npc-roll
Set values took until 230ms
Took 243ms
TRACE:handleRepeatingRowOrdering section:weapon
DEBUG: this is a NEW REPEATING_WEAPON set attack and damage dropdowns 
TRACE:handleRepeatingAttackDropdown id:undefined
TRACE: isBadRowId section:weapon, id:undefined, null ok?:true
DEBUG: GOOD ID:undefined for section weapon
TRACE:handleRepeatingDamageDropdown id:undefined
TRACE: isBadRowId section:weapon, id:undefined, null ok?:true
DEBUG: GOOD ID:undefined for section weapon
TRACE:handleRepeatingRowOrdering section:weapon
DEBUG: this is a NEW REPEATING_WEAPON set attack and damage dropdowns 
TRACE:handleRepeatingAttackDropdown id:undefined
TRACE: isBadRowId section:weapon, id:undefined, null ok?:true
DEBUG: GOOD ID:undefined for section weapon
TRACE:handleRepeatingDamageDropdown id:undefined
TRACE: isBadRowId section:weapon, id:undefined, null ok?:true
DEBUG: GOOD ID:undefined for section weapon
TRACE: isBadRowId section:weapon, id:, null ok?:false
ERROR: handleRepeatingRowOrdering invalid id:
TRACE: isBadRowId section:weapon, id:damage-ability, null ok?:false
ERROR: handleRepeatingRowOrdering invalid id:damage-ability
TRACE: isBadRowId section:weapon, id:attack-type, null ok?:false
ERROR: handleRepeatingRowOrdering invalid id:attack-type
TRACE: isBadRowId section:weapon, id:, null ok?:false
ERROR: handleRepeatingRowOrdering invalid id:
TRACE: isBadRowId section:weapon, id:damage-ability, null ok?:false
ERROR: handleRepeatingRowOrdering invalid id:damage-ability
TRACE: isBadRowId section:weapon, id:attack-type, null ok?:false
ERROR: handleRepeatingRowOrdering invalid id:attack-type
Updating character sheet values
Really updating character sheet values
Setting up repeating sections took until 13ms
Finding list of dirty attributes took until 27ms
Triggering for change:repeating_weapon
TRACE: At checkIsNewRow for section weapon
Triggering for change:repeating_weapon:total-damage
Triggering for change:repeating_weapon:total-damage_max
Triggering for change:attack-show
Triggering for change:attack-roll
Triggering for change:enhance
Triggering for change:masterwork
Triggering for change:name
Triggering for change:attack
Triggering for change:attack-mod
Triggering for change:attack-type
Triggering for change:attack-type-mod
Triggering for change:attk-effect-total-copy
Triggering for change:total-attack
Triggering for change:crit-target
Triggering for change:crit-multiplier
Triggering for change:proficiency
Triggering for change:damage-dice-num
Triggering for change:damage-die
Triggering for change:damage
Triggering for change:damage-mod
Triggering for change:damage-ability
Triggering for change:damage-ability-max
Triggering for change:damage-ability-mod
Triggering for change:dmg-effect-total-copy
Triggering for change:dmg-mod-copy
Triggering for change:total-damage
Triggering for change:range
Triggering for change:type
Triggering for change:weight
Triggering for change:ammo
Triggering for change:notes
Triggering for change:iterative-attacks-show
Triggering for change:options-show
Triggering for change:macro-text-show
Triggering for change:ids-show
Triggering for change:toggle_iterative_attack2
Triggering for change:iterative_attack2_value
Triggering for change:var_iterative_attack2_macro
Triggering for change:var_iterative_attack2
Triggering for change:toggle_iterative_attack3
Triggering for change:iterative_attack3_value
Triggering for change:var_iterative_attack3_macro
Triggering for change:var_iterative_attack3
Triggering for change:toggle_iterative_attack4
Triggering for change:iterative_attack4_value
Triggering for change:var_iterative_attack4_macro
Triggering for change:var_iterative_attack4
Triggering for change:toggle_iterative_attack5
Triggering for change:iterative_attack5_value
Triggering for change:var_iterative_attack5_macro
Triggering for change:var_iterative_attack5
Triggering for change:toggle_iterative_attack6
Triggering for change:iterative_attack6_value
Triggering for change:var_iterative_attack6_macro
Triggering for change:var_iterative_attack6
Triggering for change:toggle_iterative_attack7
Triggering for change:iterative_attack7_value
Triggering for change:var_iterative_attack7_macro
Triggering for change:var_iterative_attack7
Triggering for change:toggle_iterative_attack8
Triggering for change:iterative_attack8_value
Triggering for change:var_iterative_attack8_macro
Triggering for change:var_iterative_attack8
Triggering for change:iterative_attacks
Triggering for change:var_melee_notes
Triggering for change:var_ranged_notes
Triggering for change:var_cmb_notes
Triggering for change:var_none_notes
Triggering for change:var_attack_notes
Triggering for change:toggle_notes
Triggering for change:toggle_attack_notes
Triggering for change:macro_options
Triggering for change:macro-text
Triggering for change:new_flag
Triggering for change:row_index
Triggering for change:row_id
Triggering for change:attack-npc-roll
Querytest took until 42ms
Set values took until 218ms
Took 223ms
TRACE:handleRepeatingRowOrdering section:weapon
DEBUG: this is a NEW REPEATING_WEAPON set attack and damage dropdowns 
TRACE:handleRepeatingAttackDropdown id:undefined
TRACE: isBadRowId section:weapon, id:undefined, null ok?:true
DEBUG: GOOD ID:undefined for section weapon
TRACE:handleRepeatingDamageDropdown id:undefined
TRACE: isBadRowId section:weapon, id:undefined, null ok?:true
DEBUG: GOOD ID:undefined for section weapon
TRACE: isBadRowId section:weapon, id:, null ok?:false
ERROR: handleRepeatingRowOrdering invalid id:
TRACE: isBadRowId section:weapon, id:damage-ability, null ok?:false
ERROR: handleRepeatingRowOrdering invalid id:damage-ability
TRACE: isBadRowId section:weapon, id:attack-type, null ok?:false
ERROR: handleRepeatingRowOrdering invalid id:attack-type
Updating character sheet values
Really updating character sheet values
Setting up repeating sections took until 16ms
Finding list of dirty attributes took until 16ms
Triggering for change:str-enhance
TRACE:updateAbility ability:STR
Triggering for change:str-enhance_max
Querytest took until 20ms
Set values took until 30ms
Took 43ms
CLICKED
Updating character sheet values
Really updating character sheet values
Setting up repeating sections took until 23ms
Finding list of dirty attributes took until 23ms
Triggering for change:tab
Triggering for change:tab_max
Querytest took until 26ms
Set values took until 40ms
Took 51ms




January 27 (9 years ago)
Riley D.
Roll20 Team
I didn't have time to fully read this before the end of the day, but I will attempt to reproduce tomorrow and see what we can do on our end to help.

I guess the question is, if you don't want to create new rows but you are passing in "repeating_weapon" to setAttrs() (without a valid ID), would we just want to ignore that call on our end (e.g. don't create invalid rows with invalid IDs)? I think that's certainly a good idea...
January 27 (9 years ago)

Edited January 27 (9 years ago)
chris b.
Pro
Sheet Author
API Scripter
Hmm.. I thought the rows were being created before I called setAttrs() , but maybe not. It looks like this is what is happening: The change event seems to be called by the disabled/autocalc code, which we were relying on to propagate changes to repeating items. However, I think it is firing the change event even though there are no rows.

Triggering for change:repeating_weapon
Triggering for change:attack-type


I did not think these would fire, since there are no rows to update. But it is, that is what is throwing my code off. These event handlers are being called:

on("change:repeating_weapon", function(){ dosomething })
on("change:repeating_weapon:attack-type", function(){ dosomething })

Because the "dosomething" is within some sort of repeating item context, it does not know the ID, but the server does. So when it calls setAttrs({"repeating_weapon_attack-type-mod":123}) it works. But in our case above, the row doesn't actually exist, and there is no way for the sheetworker to know it was called in the context of an invalid / non existing row.  The setAttrs() seems to respond to this by creating a new row.

there are only 2 workarounds:  1. do NOT rely on the autocalc code to propagate changes to repeating items like I can with other fields (such as SELECTs outside of repeating items, which handles the events really fast and better than I could) and instead use getSectionIds and manually loop through and propagate changes to repeating items.  or 2. if we DO rely on the autocalc code, do NOT call setAttrs() unless we are sure we have a valid row and id. meaning default values (for fields listened to) cannot reference other attributes on the sheet outside of the repeating item. that way, such as in the SELECT above, the only way the value could reference another attribute is if the user changed it. 

So right now we are doing #2, so it's not an emergency and we can keep going forward. we were trying to make a few things easier for users but the made a huge headache for us :)  But still .. I think it's not acting as I expect. I did not think the on("change:repeating_xxx") would fire for rows that do not exist.

January 27 (9 years ago)
vÍnce
Pro
Sheet Author

chris b. said:

The setAttrs() seems to respond to this by creating a new row.
That seems like the real problem. ;-(

January 27 (9 years ago)
Riley D.
Roll20 Team
I've pushed out a new update which should no longer allow setAttrs() calls to create these types of malformed repeating rows.

Right now it's logging an error in the console ("You attempted to set an attribute beginning with 'repeating_' but did not include a Row ID..."), just because I want to make sure we're not mis-handling any valid use cases, but eventually we'll just silently discard those.

Let me know if that helps!
January 27 (9 years ago)

Edited January 27 (9 years ago)
vÍnce
Pro
Sheet Author
Quick test shows it's not creating 3 new attacks, but it still creates 1 if there are no other repeating attacks present.  I can live with that since "most" sheets will probably need an attack or six...
January 28 (9 years ago)
Riley D.
Roll20 Team
Are you seeing the error in the console? Is there a quick simple test I can do to see it make the other row?
January 28 (9 years ago)
vÍnce
Pro
Sheet Author
Test: https://app.roll20.net/join/1228293/wYvvTQ
  • Open a sheet
  • go to the Core tab and adjust STR
  • go to the Attacks tab and you will see 3 new attacks.
This version of the sheet has extra console log info to help debug.
January 28 (9 years ago)

Edited January 28 (9 years ago)
chris b.
Pro
Sheet Author
API Scripter
I can confirm it still happens, and the string "attempted" does not appear in the console log.. ...note the IDs are not null, they are "attack-type" and "damage-ability"  But what is odd is, I am not calling setAttrs({"reapeating_weapon_attack-type":x}) I am actually calling setAttrs({"repeating_weapon_attack-type-mod":x}); 
so... maybe checking for null id is not enough, we have to check whether or not the id matches a pattern all generated ids follow .

However, i made a change, and it is not happening anymore. Basically what I did is, when the event is 
on("change:repeating_weapon", dosomething) 
I do not assume the row is there and don't set anything on it at all. Instead I use getSectionIDs to search for the new row and then update it using the ID. (this sort of defeats the purpose of having access to that event)

BUT  when the event is for a specific field:
on("change:repeating_weapon:somefield", dosomethingelse)
it is safe to assume the row exists and to call setAttrs({"repeating_weapon_somefield":x}) and it works as expected.

However, I still have to check for bad IDs, because getSectionIDs still returns one invalid row with ID of "weapon", and now I can guarantee it is happening BEFORE i call setAttrs()!!

so there is still a bug somewhere. we just now know a workaround that still lets us do what we want, at least in this case.

here is the code
https://gist.github.com/plutosdad/70cfefc6d3fce7fd81bf
line 11760 is where the bad id is caught, inside handleRepeatingRowOrdering()
(which is called by checkIsNewRow() which is called by line 13247 at the on("change:repeating_weapon") which is called by the autocalc code when another field outside the repeating section is updated that is referenced in the repeating section in a SELECT
January 28 (9 years ago)

Edited January 28 (9 years ago)
Riley D.
Roll20 Team
On the getSectionIDs() call that is returning weapon, is that in a new game that hasn't had this bug happen? Because I think what was happening before was that a row with an ID of "weapon" was being created.

In addition, something I recently added that may help here (although it may also be unnecessary now) is some information is now returned to the on() callback: the ID of the attribute that triggered the change.

So you can now do:

on("change:repeating_weapon", function(eventinfo) {
   eventinfo.sourceAttribute; //this is the full name (including the repeating ID) of the attribute that triggered the call.
});

I will take a look at your test case here shortly to see if I see any other bugs I can fix. Thanks!

EDIT: I just loaded up the test case and it's not happening anymore...at least not on a new Character I created. I do have the latest verson pulled down from Github though that's not live yet (but will be very shortly). So was it fixed in there already due to Chris' changes?
January 28 (9 years ago)
chris b.
Pro
Sheet Author
API Scripter
Awesome that will be very helpful! Not only for the "parent" event where anything is changed, but also to help us speed up the updates to the row itself instead of doing a bunch of recalculations that may not be necessary.
January 28 (9 years ago)
chris b.
Pro
Sheet Author
API Scripter
EDIT: I just loaded up the test case and it's not happening anymore...at least not on a new Character I created. I do have the latest verson pulled down from Github though that's not live yet (but will be very shortly). So was it fixed in there already due to Chris' changes?
I'm not sure which one Vince has loaded.

Gist without fix: https://gist.github.com/plutosdad/b084fafe88f8eeb10641   (this was what Vince had there yesterday)

Gist with fix: https://gist.github.com/plutosdad/70cfefc6d3fce7fd81bf

January 28 (9 years ago)

Edited January 28 (9 years ago)
chris b.
Pro
Sheet Author
API Scripter
HERE IS A CAMPAIGN WITHOUT FIX 

(I removed the join link and put it in flag report for the devs. It was done to protect your campaign from random people joining-Pat S. Mod.)

sorry the gist is not too useful without css.

The very firct PC at top is the oldest
others i mostly created yesterday

just make a new one
or pick one and delete any attacks first, then go back to CORE and update Strength to test
January 28 (9 years ago)
Riley D.
Roll20 Team
Okay, thanks, the last test case helps.

So here's a log with some additional logging I added on our end showing what the full story is, I think:

https://gist.github.com/rileydutton/847c7e351ab8f7...

Walking through it, it looks like you are calling setAttrs() with an invalid repeating section ID before anything happens with getSectionIDs(). Line 28 is the first time that we are hearing a call to getSectionIDs() on our end, and we're returning an empty array on line 29, but then the script is still proceeding to call setAttrs (as you can see on line 30 + 31), even though there is no valid repeating row ID.

It looks like my safeguard is getting confused by the fact that it's turning it into a double-underscore or something ("repeating_weapon__attack-type-mod"). 

You can then see later on that once the invalid repeating section has been created, getSectionIDs() will respond with it even though it probably shouldn't (line 74 + 76). And then things just get worse from there :-)

Anywho, I will fix my safeguard so that it handles this test case and never allows that first setAttrs() to succeed with the invalid ID. I will also fix getSectionIDs() so that it only ever returns IDs that are checked to be a valid ID format.

My guess is that your fix or using the new eventInfo parameter should keep this from happening anyway, but might as well put in some additional safeguards just in case.


January 28 (9 years ago)
chris b.
Pro
Sheet Author
API Scripter
OH yeah, i forgot, the double underscore is a bug in my end which i found later.

thanks so much. Yes it's best to put checks I think since even though I spent many hours on this and figured out a workaround, someone else would make the same mistake later, and you'd have to go through it all over again trying to figure out what is wrong.

After you implement those changes i'll try using the eventinfo, since that will be faster probably than my workaround.
January 28 (9 years ago)
Riley D.
Roll20 Team
Okay so I pushed all those changes to Dev. The test case seems to be working in that the Attacks are no longer getting created when they shouldn't be. However, I did notice that that attack in that Test Case wasn't always updating properly when I changed things (such as the STR mod or the Buffs).

However, I tested the latest version of the PF Sheet from the Github repo on Dev and all of that was working fine. No extra attacks, everything seemed to be updating properly, etc. So I guess let me know if we're good to go and if so I'll push those fixes to Main. Just want to make sure I didn't re-break something :-)
January 28 (9 years ago)
chris b.
Pro
Sheet Author
API Scripter
I'll check it out. I think Vince told me some of those bugs were pre-existing, but I will make sure.
January 28 (9 years ago)

Edited January 28 (9 years ago)
chris b.
Pro
Sheet Author
API Scripter
WORKING 
we are good to go

I uploaded my "fixed" html since apparently the other one had some other bugs in it as well (Which Vince pointed out, like damage not updating even before this, so I know that is not your fix.)

Using the old non-fixed sheet, I could see the new error message you created. With the fixed sheet I don't even get that far because that weird "weapon" row never even appears! woohoo!

So now editing a field inside the repeating section updates the repeating section, and editing a field outside the repeating section still works and updates all repeating rows. In addition, updating fields when there are no rows does not create new invalid rows.

I have a different bug that is still forcing me to change the dropdown and change it back but that has nothing to do with your change and the core functionality we need is all there.

so it looks like it's all working. I approve this fix :)

thanks for the quick turnaround! this is great.
January 28 (9 years ago)
Riley D.
Roll20 Team
Should be live on Main as well.
January 28 (9 years ago)
vÍnce
Pro
Sheet Author
Sorry for being late to the party (ear infection and cold...)  I should have put the version on my test case post.  The version I submitted to github "rolled back" the selector changes we made on attacks.  Basically it was the last stable release with a few other changes.  All said, it looks like you guys got it worked out.  My test case is working as expected.  Thanks again for your personal assistance Riley.  Cheers
January 28 (9 years ago)
chris b.
Pro
Sheet Author
API Scripter
Vince I'll send you what we need to put in prod, the rollback was the right choice but don't put any old thing, i have to make sure it's right, plus whatever you fixed.
Ill pm you
First maybe i'll get some sleep
January 30 (9 years ago)
chris b.
Pro
Sheet Author
API Scripter
Here is the pull request with allour fixes

https://github.com/Roll20/roll20-character-sheets/pull/1358

I don't want to bug people to work on the weekend, but can we get this in?
January 30 (9 years ago)
Riley D.
Roll20 Team
chris b. said:
Here is the pull request with allour fixes

https://github.com/Roll20/roll20-character-sheets/pull/1358

I don't want to bug people to work on the weekend, but can we get this in?

It's live.
January 30 (9 years ago)
chris b.
Pro
Sheet Author
API Scripter
Awesome thanks!
January 30 (9 years ago)
vÍnce
Pro
Sheet Author
Thank you.
February 04 (9 years ago)
Magik
Sheet Author
I just reproduced the issue at 6:43 PM PST today using a fresh character sheet (Ostihul Ajitrou is the name) on the Pathfinder Beta game (https://app.roll20.net/editor/setcampaign/801350).

I simply
1) opened the sheet
2) clicked on each tab that has repeating entries to confirm that there were none
3) went to the Core tab
4) entered some base ability scores: 14, 17, 14, 13, 18, 7 and then
5) went to the Classes tab which was fine
6) went to the Attacks tab and found 7 new attack entries (0 through 6) and then
7) went to the Spells tab and found 2 new spell entries (0 and 1)

Magik
February 04 (9 years ago)

Edited February 04 (9 years ago)
Magik
Sheet Author
If I had to guess, I'd say that we are looking at something where the java workers catch the event that the ability bonus has changed, updates the fields of any repeating items and then when it saves, might be referencing the wrong object and thus creates a new one. Since I've seen the behavior with several attack entries that creating a new one will copy the contents of another entry to be its starting values; instead of being all the default values, I think that it is a problem somewhere when it saves/writes to the database.

EDIT: In addition, the Classes, Feats, Items, and Details tabs have repeating entries, but none of the ghost entries were created. That is because there are no java workers looking for stat changes (probably no java workers at all).
February 04 (9 years ago)
Magik
Sheet Author
There is also an issue with duplicate attributes being created. An issue with the saving of repeating entries may be the cause of that issue also.
February 04 (9 years ago)

Edited February 04 (9 years ago)
chris b.
Pro
Sheet Author
API Scripter
Can you make it happen again, and open the JavaScript console. There are error messages that will either start with "ERROR:" with the invalid ID it has detected (from the pf sheet) or something like "you have attempted" to set an I'd that doesn't exist (from Riley's server code, I only remember the word attemped will appear)
Since this is the exact scenario we just fixed.
Actually it's not just javascript, the weapons and spells have dropdown that reference other attributes. None of the others do, except, well class abilities reference class names I think. I've never tried to make that repeat.
If I still had hair I'd be pulling it out.
February 04 (9 years ago)
vÍnce
Pro
Sheet Author
With a brand new sheet
Changing STR results in 2 new attacks
app.js?1454428537:36 CLICKED
app.js?1454428537:36 Really updating character sheet values
app.js?1454428537:36 Setting up repeating sections took until 9ms
app.js?1454428537:36 Finding list of dirty attributes took until 10ms
app.js?1454428537:36 Querytest took until 11ms
app.js?1454428537:36 Set values took until 17ms
app.js?1454428537:36 Took 19ms
app.js?1454428537:36 Really updating character sheet values
app.js?1454428537:36 Setting up repeating sections took until 9ms
app.js?1454428537:36 Finding list of dirty attributes took until 11ms
VM41:2028 at handleDefenseDropdown:CMD-ability1
VM41:3588 Object {sourceAttribute: "repeating_weapon_-k7p5fljouxw3y1icjdq_damage-ability"}
app.js?1454428537:36 Querytest took until 14ms
VM41:3588 Object {sourceAttribute: "repeating_weapon_-k9wvcpqct2f-gob4axe_damage-ability"}
app.js?1454428537:36 Set values took until 53ms
app.js?1454428537:36 Took 55ms
VM41:3613 Object {repeating_weapon_new_flag: "0", repeating_weapon_row_id: ""}
VM41:3616 id is : -k7p5fljouxw3y1icjdq
VM41:3613 Object {repeating_weapon_new_flag: "0", repeating_weapon_row_id: ""}
VM41:3616 id is : -k9wvcpqct2f-gob4axe
app.js?1454428537:36 Really updating character sheet values
app.js?1454428537:36 Setting up repeating sections took until 37ms
app.js?1454428537:36 Finding list of dirty attributes took until 56ms
VM41:3588 Object {sourceAttribute: "repeating_weapon_-k7p5fljouxw3y1icjdq_row_id"}
VM41:3588 Object {sourceAttribute: "repeating_weapon_-k9wvcpqct2f-gob4axe_row_id"}
app.js?1454428537:36 Querytest took until 59ms
app.js?1454428537:36 Set values took until 171ms
app.js?1454428537:36 Took 174ms
app.js?1454428537:36 Really updating character sheet values
app.js?1454428537:36 Setting up repeating sections took until 9ms
app.js?1454428537:36 Finding list of dirty attributes took until 12ms
VM41:3588 Object {sourceAttribute: "repeating_weapon_-k7p5fljouxw3y1icjdq_attack-type"}
VM41:3588 Object {sourceAttribute: "repeating_weapon_-k9wvcpqct2f-gob4axe_attack-type"}
app.js?1454428537:36 Querytest took until 16ms
app.js?1454428537:36 Set values took until 128ms
app.js?1454428537:36 Took 131ms
VM41:3613 Object {repeating_weapon_new_flag: 1, repeating_weapon_row_id: "-k7p5fljouxw3y1icjdq"}
VM41:3613 Object {repeating_weapon_new_flag: 1, repeating_weapon_row_id: "-k9wvcpqct2f-gob4axe"}
app.js?1454428537:36 Really updating character sheet values
app.js?1454428537:36 Setting up repeating sections took until 22ms
app.js?1454428537:36 Finding list of dirty attributes took until 38ms
VM41:3588 Object {sourceAttribute: "repeating_weapon_-k7p5fljouxw3y1icjdq_attack-type-mod"}
VM41:3588 Object {sourceAttribute: "repeating_weapon_-k9wvcpqct2f-gob4axe_attack-type-mod"}
app.js?1454428537:36 Querytest took until 41ms
app.js?1454428537:36 Set values took until 154ms
app.js?1454428537:36 Took 157ms
Changing BAB results in 2 new attacks
2app.js?1454428537:36 CLICKED
app.js?1454428537:36 Really updating character sheet values
app.js?1454428537:36 Setting up repeating sections took until 10ms
app.js?1454428537:36 Finding list of dirty attributes took until 10ms
app.js?1454428537:36 Querytest took until 11ms
app.js?1454428537:36 Set values took until 20ms
app.js?1454428537:36 Took 21ms
app.js?1454428537:36 Really updating character sheet values
app.js?1454428537:36 Setting up repeating sections took until 8ms
app.js?1454428537:36 Finding list of dirty attributes took until 9ms
app.js?1454428537:36 Querytest took until 10ms
app.js?1454428537:36 Set values took until 18ms
app.js?1454428537:36 Took 20ms
app.js?1454428537:36 Really updating character sheet values
app.js?1454428537:36 Setting up repeating sections took until 8ms
app.js?1454428537:36 Finding list of dirty attributes took until 11ms
VM41:3588 Object {sourceAttribute: "repeating_weapon_-k7p5fljouxw3y1icjdq_attack-type"}
app.js?1454428537:36 Querytest took until 13ms
VM41:3588 Object {sourceAttribute: "repeating_weapon_-k9wvcpqct2f-gob4axe_attack-type"}
app.js?1454428537:36 Set values took until 48ms
app.js?1454428537:36 Took 49ms
VM41:3613 Object {repeating_weapon_new_flag: "0", repeating_weapon_row_id: ""}
VM41:3616 id is : -k7p5fljouxw3y1icjdq
VM41:3613 Object {repeating_weapon_new_flag: "0", repeating_weapon_row_id: ""}
VM41:3616 id is : -k9wvcpqct2f-gob4axe
app.js?1454428537:36 Really updating character sheet values
app.js?1454428537:36 Setting up repeating sections took until 34ms
app.js?1454428537:36 Finding list of dirty attributes took until 61ms
VM41:3588 Object {sourceAttribute: "repeating_weapon_-k7p5fljouxw3y1icjdq_row_id"}
VM41:3588 Object {sourceAttribute: "repeating_weapon_-k9wvcpqct2f-gob4axe_row_id"}
app.js?1454428537:36 Querytest took until 64ms
app.js?1454428537:36 Set values took until 173ms
app.js?1454428537:36 Took 175ms
Changing Wis results in 1 new class ability
3app.js?1454428537:36 CLICKED
app.js?1454428537:36 Really updating character sheet values
app.js?1454428537:36 Setting up repeating sections took until 10ms
app.js?1454428537:36 Finding list of dirty attributes took until 10ms
app.js?1454428537:36 Querytest took until 11ms
app.js?1454428537:36 Set values took until 18ms
app.js?1454428537:36 Took 20ms
app.js?1454428537:36 Really updating character sheet values
app.js?1454428537:36 Setting up repeating sections took until 8ms
app.js?1454428537:36 Finding list of dirty attributes took until 9ms
VM41:3588 Object {sourceAttribute: "repeating_class-ability_-k2udsgt-fyyxlnbgssy_max-calculation"}
app.js?1454428537:36 Querytest took until 10ms
app.js?1454428537:36 Set values took until 47ms
app.js?1454428537:36 Took 48ms
VM41:3613 Object {repeating_class-ability_new_flag: "0", repeating_class-ability_row_id: ""}
VM41:3616 id is : -k2udsgt-fyyxlnbgssy
app.js?1454428537:36 Really updating character sheet values
app.js?1454428537:36 Setting up repeating sections took until 12ms
app.js?1454428537:36 Finding list of dirty attributes took until 20ms
VM41:3588 Object {sourceAttribute: "repeating_class-ability_-k2udsgt-fyyxlnbgssy_row_id"}
app.js?1454428537:36 Querytest took until 23ms
app.js?1454428537:36 Set values took until 54ms
app.js?1454428537:36 Took 56ms
app.js?1454428537:36 Really updating character sheet values
app.js?1454428537:36 Setting up repeating sections took until 9ms
app.js?1454428537:36 Finding list of dirty attributes took until 9ms
app.js?1454428537:36 Querytest took until 11ms
app.js?1454428537:36 Set values took until 30ms
app.js?1454428537:36 Took 32ms

February 04 (9 years ago)
Magik
Sheet Author
Can you create a few more fresh/blank characters? Or give me GM rights on the the PF Beta game if you want.