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

Clicking a button on a character sheet causes whole browser tab to freeze for 2 minutes and 20 seconds. Possible very long string issue.

1447042930

Edited 1447076341
Chris D.
Pro
Sheet Author
API Scripter
Compendium Curator
I am writing my own Earthdawn Character sheet.&nbsp; I have a button that looks like it ought to be working, but when I press it the browser window freezes up (becomes unresponsive) for 2 minutes and 15 to 20 seconds, before becoming responsive again without any error messages or anything from roll20. Chrome gives a popup that the page has become unresponsive and asks if I want to kill it or wait.&nbsp; More detail: (and how to reproduce the problem).&nbsp; I have a campaign on the Dev server named "Earthdawn".&nbsp; Go into the journals and open any character sheet - I usually open Darron. Go to the NPC tab. Click one of the Test1 buttons, just to prove that the API is active and responsive. &nbsp; Press&nbsp;"Link Token Bad". Click one of the other Tab buttons just to prove that the browser is unresponsive.&nbsp; 2 minutes and 20 seconds later the browser will finally switch to the new tab.&nbsp; Note that I have the API set to log when it gets a message, and it never gives any indication that the message was actually sent or received. It just seems to disappear.&nbsp; The html of the button that does not work is&nbsp; &lt;button name="roll_Link-TokenBad" type="roll" value="!edParse~ charID: @{character_id} ~ LinkToken : [[@{Karma_max}]] : [[@{Damage_max}]] : [[@{Wounds_max}]]" &gt;Link Token Bad&lt;/button&gt; I did some experimenting and found it never worked with @{Karma_max} there, always worked when it was not there. Karma_max is&nbsp; &lt;input name="attr_Karma_max" type="number" disabled value="((@{Karma-Modifier}*@{repeating_discipline_0_Circle})+@{Misc-Karma-Max-Adjust}+@{Attr-Costs})" style="width:3em;" title="@{Karma_max}: Maximum Karma"&gt; On a hunch I took @{Attr-Costs} out of Karma_max, and everything worked fine. Here is where it gets fun. Attr_Costs is defined as&nbsp; &lt;input name="attr_Attr-Costs" type="number" disabled style="width: 3em;" title="@{Attr-Costs} Number of Attribute points remaining from the starting 25, after raising Racial attributes to Orig values." value="(25-(@{Attr-Costs-Dex}+@{Attr-Costs-Str}+@{Attr-Costs-Tou}+@{Attr-Costs-Per}+@{Attr-Costs-Wil}+@{Attr-Costs-Cha}))" &gt; and those 6 values are defined as&nbsp; &lt;input name="attr_Attr-Costs-Dex" type="number" disabled style="display: none;" value="((@{Attrib-Dex-Orig}-@{Attrib-Dex-Race})+(((@{Attrib-Dex-Orig}-@{Attrib-Dex-Race}-3)+abs(@{Attrib-Dex-Orig}-@{Attrib-Dex-Race}-3))/2)+(((@{Attrib-Dex-Orig}-@{Attrib-Dex-Race}-6)+abs(@{Attrib-Dex-Orig}-@{Attrib-Dex-Race}-6))/2))" &gt; &lt;input name="attr_Attr-Costs-Str" type="number" disabled style="display: none;" value="((@{Attrib-Str-Orig}-@{Attrib-Str-Race})+(((@{Attrib-Str-Orig}-@{Attrib-Str-Race}-3)+abs(@{Attrib-Str-Orig}-@{Attrib-Str-Race}-3))/2)+(((@{Attrib-Str-Orig}-@{Attrib-Str-Race}-6)+abs(@{Attrib-Str-Orig}-@{Attrib-Str-Race}-6))/2))" &gt; &lt;input name="attr_Attr-Costs-Tou" type="number" disabled style="display: none;" value="((@{Attrib-Tou-Orig}-@{Attrib-Tou-Race})+(((@{Attrib-Tou-Orig}-@{Attrib-Tou-Race}-3)+abs(@{Attrib-Tou-Orig}-@{Attrib-Tou-Race}-3))/2)+(((@{Attrib-Tou-Orig}-@{Attrib-Tou-Race}-6)+abs(@{Attrib-Tou-Orig}-@{Attrib-Tou-Race}-6))/2))" &gt; &lt;input name="attr_Attr-Costs-Per" type="number" disabled style="display: none;" value="((@{Attrib-Per-Orig}-@{Attrib-Per-Race})+(((@{Attrib-Per-Orig}-@{Attrib-Per-Race}-3)+abs(@{Attrib-Per-Orig}-@{Attrib-Per-Race}-3))/2)+(((@{Attrib-Per-Orig}-@{Attrib-Per-Race}-6)+abs(@{Attrib-Per-Orig}-@{Attrib-Per-Race}-6))/2))" &gt; &lt;input name="attr_Attr-Costs-Wil" type="number" disabled style="display: none;" value="((@{Attrib-Wil-Orig}-@{Attrib-Wil-Race})+(((@{Attrib-Wil-Orig}-@{Attrib-Wil-Race}-3)+abs(@{Attrib-Wil-Orig}-@{Attrib-Wil-Race}-3))/2)+(((@{Attrib-Wil-Orig}-@{Attrib-Wil-Race}-6)+abs(@{Attrib-Wil-Orig}-@{Attrib-Wil-Race}-6))/2))" &gt; &lt;input name="attr_Attr-Costs-Cha" type="number" disabled style="display: none;" value="((@{Attrib-Cha-Orig}-@{Attrib-Cha-Race})+(((@{Attrib-Cha-Orig}-@{Attrib-Cha-Race}-3)+abs(@{Attrib-Cha-Orig}-@{Attrib-Cha-Race}-3))/2)+(((@{Attrib-Cha-Orig}-@{Attrib-Cha-Race}-6)+abs(@{Attrib-Cha-Orig}-@{Attrib-Cha-Race}-6))/2))" &gt; All the Attribute Originals are input numbers, but all the Attribute Races are something similar to&nbsp; &lt;span&gt;&lt;input name="attr_Attrib-Dex-Race" type="number" disabled style="width: 3em;" title="@{Attrib-Dex-Race} Base Racial Dexterity attribute." value="((@{Race-Obsidiman}*8)+(@{Race-Dwarf}*9)+((@{Race-Human}+@{Race-Ork}+@{Race-Troll})*10)+((@{Race-Tskrang}+@{Race-Windling})*11)+(@{Race-Elf}*12))" &gt;&lt;/span&gt; and for example Race-Dwarf is defined as &lt;input type="number" name="attr_Race-Dwarf" value="(1-(((abs(@{Race}- 1 )+1)-abs(abs(@{Race}- 1 )-1))/2))" disabled /&gt; Now I should point out that all of this works fine on the character sheet, and when I change any of the attribute - Orig values, the Attri_Costs updates almost instantly.&nbsp; But I know that the system tends to store things as formulas rather than values, and it occurs to me that&nbsp;if each Race thing is about 50 characters, and if each attribute calls 8 races, and each cost calls each race 5 times, and there are 6 attributes, then anything that tried to look at all of that as one long string would be looking at over 12,000 characters. I don't KNOW that that is the problem, but it was the first thing that popped into my head, and getting rid of Attri_Cost did solve the problem.&nbsp; So anyway. Whenever I try to pass [[@{Karma_max}]] the browser freezes. If I get remove @{Attr-Costs} from Karma_max so that it is not within the [[]] It all works OK.&nbsp; Am I overflowing something by going to deep or with something too long? Additional boring details. OS Type,OS Version,Browser Type,IP Address,Javascript Enabled,Cookies Enabled,Color Depth,Screen Resolution,Browser Window Size,Flash Version,User Agent Windows,Windows NT 10.0,Chrome,###.###.###.###,Yes,Yes,24,1920 x 1080,1920 x 945,19.0.-1,"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36" Console Log app.roll20dev.net/:12 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval' https://*.googlesyndication.com https://*.doubleclick.net https://*.googlesyndication.com <a href="https://www.googletagservices.com" rel="nofollow">https://www.googletagservices.com</a> https://*.googlesyndication.com <a href="https://www.google-analytics.com" rel="nofollow">https://www.google-analytics.com</a> https://*.googlesyndication.com <a href="https://d3clqjduf2gvxg.cloudfront.net" rel="nofollow">https://d3clqjduf2gvxg.cloudfront.net</a> https://*.googlesyndication.com https://*.firebaseio.com https://*.googlesyndication.com https://*.opentok.com https://*.googlesyndication.com <a href="http://www.google-analytics.com" rel="nofollow">http://www.google-analytics.com</a>". Either the 'unsafe-inline' keyword, a hash ('sha256-QFNj5WSIcbkYea+voZiRmtboW2sO9uEZx+ID3b5UXds='), or a nonce ('nonce-...') is required to enable inline execution. app.roll20dev.net/:13 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval' https://*.googlesyndication.com https://*.doubleclick.net https://*.googlesyndication.com <a href="https://www.googletagservices.com" rel="nofollow">https://www.googletagservices.com</a> https://*.googlesyndication.com <a href="https://www.google-analytics.com" rel="nofollow">https://www.google-analytics.com</a> https://*.googlesyndication.com <a href="https://d3clqjduf2gvxg.cloudfront.net" rel="nofollow">https://d3clqjduf2gvxg.cloudfront.net</a> https://*.googlesyndication.com https://*.firebaseio.com https://*.googlesyndication.com https://*.opentok.com https://*.googlesyndication.com <a href="http://www.google-analytics.com" rel="nofollow">http://www.google-analytics.com</a>". Either the 'unsafe-inline' keyword, a hash ('sha256-v19duySXMwXd3zUU660hZgcRTRW/BoLT6eLuziV0Xdk='), or a nonce ('nonce-...') is required to enable inline execution. app.js?1443189881:29 70 app.js?1443189881:30 TOUCH SUPPORTED: false app.js?1443189881:30 USING WEBGL ACCELERATION... app.js?1443189881:30 WEBGL STARTUP SUCCESS app.js?1443189881:25 select app.js?1443189881:25 Switch mode to select app.js?1443189881:40 Initializing new dice engine with randomness... app.js?1443189881:40 Using random entropy app.js?1443189881:43 Compiling sheet... jquery.min.js:2 Mixed Content: The page at ' <a href="https://app.roll20dev.net/editor/" rel="nofollow">https://app.roll20dev.net/editor/</a> ' was loaded over HTTPS, but requested an insecure image ' <a href="http://imgsrv.roll20.net/?src=cf.geekdo-images.com/images/pic514823_t.jpg" rel="nofollow">http://imgsrv.roll20.net/?src=cf.geekdo-images.com/images/pic514823_t.jpg</a> '. This content should also be served over HTTPS. app.js?1443189881:43 Finding sheet rolls... app.js?1443189881:44 window resize app.js?1443189881:30 Final set zoom! app.js?1443189881:30 UPDATE GL SIZE! app.js?1443189881:30 Final set zoom! tutorial_tips.js:7 tuts loaded app.js?1443189881:36 Final page load. app.js?1443189881:44 Refresh jukebox List! app.js?1443189881:35 Auth'ed. app.js?1443189881:35 Go post auth! app.js?1443189881:35 initial setup app.js?1443189881:36 Scan for new plays! app.js?1443189881:38 refershing page listings! app.js?1443189881:35 Got players value... app.js?1443189881:35 joining game... 3app.js?1443189881:33 Full load page! app.js?1443189881:35 We have 3 pages app.js?1443189881:34 Player -Juqd6bJVF43cGrbxX1d is offline... app.js?1443189881:34 1 app.js?1443189881:44 1 app.js?1443189881:34 Player -JvfReLm7YXgzFoXBXGj is offline... app.js?1443189881:34 Player -JvfVslPd7IJuXeJ_DtS is offline... app.js?1443189881:34 Player -Jvg9UyMNIymPt3k8Gdv is offline... app.js?1443189881:34 Player -JvlR02t9gDg-KNABVbU is offline... app.js?1443189881:35 Deferred finish joining... app.js?1443189881:29 Firebase Online app.js?1443189881:34 I think I should be first? app.js?1443189881:34 FIRST PLAYER: -Juqd6bJVF43cGrbxX1d app.js?1443189881:42 Refresh Journal List! app.js?1443189881:42 Search took 11ms app.js?1443189881:35 handle page changes app.js?1443189881:35 false app.js?1443189881:38 refershing page listings! jquery.min.js:2 GET <a href="http://imgsrv.roll20.net/?src=cf.geekdo-images.co" rel="nofollow">http://imgsrv.roll20.net/?src=cf.geekdo-images.co</a>... 502 (Bad Gateway)p.extend.clean @ jquery.min.js:2p.buildFragment @ jquery.min.js:2p.extend.parseHTML @ jquery.min.js:2p.fn.p.init @ jquery.min.js:2p @ jquery.min.js:2(anonymous function) @ app.js?1443189881:43k @ jquery.min.js:2l.fireWith @ jquery.min.js:2p.extend.ready @ jquery.min.js:2D @ jquery.min.js:2 app.js?1443189881:35 init active page! app.js?1443189881:33 activate page! app.js?1443189881:33 FULLY ACTIVATE VIEWS FOR PAGE. app.js?1443189881:33 Graphics: 0 app.js?1443189881:33 Paths: 0 app.js?1443189881:33 Reorder by ZORDER app.js?1443189881:36 Scan for new plays! app.js?1443189881:38 refershing page listings! app.js?1443189881:42 initiatlizing video chat app.js?1443189881:42 Connecting to WebRTC app.js?1443189881:44 Refresh jukebox List! app.js?1443189881:32 Do refresh link cache! app.js?1443189881:42 Refresh Journal List! app.js?1443189881:42 Search took 21ms 5app.js?1443189881:36 Updating character sheet values 2app.js?1443189881:33 Reorder by ZORDER app.js?1443189881:32 Swapping <a href="https://s3.amazonaws.com/files.d20.io/images/1108" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/1108</a>... to <a href="https://s3.amazonaws.com/files.d20.io/images/1108" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/1108</a>... app.js?1443189881:32 Swapping <a href="https://s3.amazonaws.com/files.d20.io/images/2483" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/2483</a>... to <a href="https://s3.amazonaws.com/files.d20.io/images/2483" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/2483</a>... 3app.js?1443189881:33 Reorder by ZORDER 2app.js?1443189881:32 Swapping <a href="https://s3.amazonaws.com/files.d20.io/images/1107" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/1107</a>... to <a href="https://s3.amazonaws.com/files.d20.io/images/1107" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/1107</a>... app.js?1443189881:33 Reorder by ZORDER app.js?1443189881:32 Swapping <a href="https://s3.amazonaws.com/files.d20.io/images/1107" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/1107</a>... to <a href="https://s3.amazonaws.com/files.d20.io/images/1107" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/1107</a>... app.js?1443189881:33 Reorder by ZORDER app.js?1443189881:42 Connected to session app.js?1443189881:42 Someone just connected. app.js?1443189881:42 It's us? 5app.js?1443189881:32 setting src app.js?1443189881:36 Show Character View Dialog! app.js?1443189881:36 --- RENDER CHARACTIVE VIEW ---- app.js?1443189881:36 CLICKED app.js?1443189881:36 Redoing charsheet html app.js?1443189881:36 115ms to end of html app.roll20dev.net/:1 Mixed Content: The page at ' <a href="https://app.roll20dev.net/editor/" rel="nofollow">https://app.roll20dev.net/editor/</a> ' was loaded over HTTPS, but requested an insecure image ' <a href="http://imgsrv.roll20.net/?src=cf.geekdo-images.com/images/pic514823_t.jpg" rel="nofollow">http://imgsrv.roll20.net/?src=cf.geekdo-images.com/images/pic514823_t.jpg</a> '. This content should also be served over HTTPS. app.js?1443189881:36 Updating character sheet values app.js?1443189881:36 Setting up repeating sections took until 20ms app.js?1443189881:36 Updating ALL VALUES app.js?1443189881:36 Finding list of dirty attributes took until 21ms app.js?1443189881:36 Querytest took until 21ms app.js?1443189881:36 Set values took until 501ms app.js?1443189881:36 Appending to sheetform app.js?1443189881:36 Appending to screen took until 510ms app.js?1443189881:36 Took 511ms 2app.js?1443189881:36 CLICKED app.js?1443189881:36 Updating character sheet values app.js?1443189881:36 Setting up repeating sections took until 5ms app.js?1443189881:36 Finding list of dirty attributes took until 5ms app.js?1443189881:36 Querytest took until 6ms app.js?1443189881:36 Set values took until 10ms app.js?1443189881:36 Took 11ms app.js?1443189881:41 Finished after going 5 levels deep. app.js?1443189881:41 Begin processing op! app.js?1443189881:41 Levels deep: 0 app.js?1443189881:41 Levels deep: 0 app.js?1443189881:36 CLICKED app.js?1443189881:41 Finished 0 app.js?1443189881:41 Levels deep: 0 app.js?1443189881:41 Finished 1 app.js?1443189881:41 Levels deep: 0 app.js?1443189881:41 Inline rolls complete! app.js?1443189881:41 Finished after going 8 levels deep. app.js?1443189881:41 Begin processing op! Note: I think it was here it took 130 seconds between. &nbsp; It might have been the previous one app.js?1443189881:41 Levels deep: 0 app.js?1443189881:41 Levels deep: 0 app.js?1443189881:41 Levels deep: 0 2app.js?1443189881:36 CLICKED app.js?1443189881:29 Firebase Offline app.js?1443189881:34 Player -Juqd6bJVF43cGrbxX1d is offline... app.js?1443189881:41 Finished 0 app.js?1443189881:41 Levels deep: 0 app.js?1443189881:41 Finished 1 app.js?1443189881:41 Levels deep: 0 app.js?1443189881:41 Finished 2 app.js?1443189881:41 Levels deep: 0 app.js?1443189881:41 Inline rolls complete! app.js?1443189881:36 Updating character sheet values app.js?1443189881:36 Setting up repeating sections took until 6ms app.js?1443189881:36 Finding list of dirty attributes took until 6ms app.js?1443189881:36 Querytest took until 8ms app.js?1443189881:36 Set values took until 12ms app.js?1443189881:36 Took 13ms app.js?1443189881:29 Firebase Online Thank you for your kind attention. I would like to get it working with passing the correct parameters. &nbsp;Chris
Hi Chris, What is the exact roll being made? Can you go ahead and private message me an invite to the game in question or post the exact macro used for the roll so I can test it myself.&nbsp;
1447110604
Chris D.
Pro
Sheet Author
API Scripter
Compendium Curator
Thank you very much, I PMed an invite. The command that will freeze it is: !edParse~ charID: @{Darron|character_id} ~ LinkToken : [[@{Darron|Karma_max}]] : [[@{Darron|Wounds_max}]] : [[@{Darron|Damage_max}]] However !edParse~ charID: @{Darron|character_id} ~ LinkToken : [[@{Darron|Karma_tmp}]] : [[@{Darron|Damage_max}]] : [[@{Darron|Wounds_max}]] will not. &nbsp; Notice that one uses Karma_tmp. Thank you for looking into this!
1447254151
Chris D.
Pro
Sheet Author
API Scripter
Compendium Curator
Hum, well the new code on the dev server definitely seems to have changed things.&nbsp; Now I am mostly getting an orange message that says&nbsp; TypeError: e.replace is not a function However I think that is a different bug. Several places in my code I was looking at the first repeating discipline field by simply using&nbsp;@{repeating_discipline_0_Circle}, Now I am going to have to rethink that. I have made some changes and managed to find one circumstance were I still get the 2 minute and 20 second error, but this is the section that is going to most benefit from worker threads, so the whole section is going to be rewritten anyway. It might take a few days.&nbsp;&nbsp;Hopefully this problem will go away with the rewrite.&nbsp;
Chris, I had the same problem. Its a pain, but if you open every token (by double clicking) and then press save, it seems to clear the issue.&nbsp;