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

Compendium drag broken for high-latency connections

1530099914

Edited 1530111935
Lucian
Pro
API Scripter
Ok, so this is a really awful one I'm afraid. It would seem like the latest update has introduced a non-deterministic/race-condition bug with compendium drop. Since yesterday,&nbsp; the Shaped Sheet mostly no longer receives compendium data when a monster is dropped on the canvas. The attributes are not populated, and no sheet workers are fired as a result. Note that if you drag a monster onto an existing sheet, it works fine - the problem is confined to dropping new monsters directly onto the canvas. I attempted to construct a minimal testcase, and somewhat screwed it up. So I went back to the shaped sheet and started cutting things out to see when it started working. After a while it became clear that there wasn't a simple answer to that question. I cut out a bunch of stuff and it was still broken; and then I ran the same test again without changing anything and it worked. Urgh. I tried cutting out different parts of the sheet and there was no clear relationship between the removal of specific parts and when it started working. At this point, what *seems* to be the case is that the behaviour is connected to the size of the sheet, but not to any specific content. The more I prune the sheet down, the less often it happens. Not that this behaviour can and does occur even with no sheetworker scripts present at all, so I'm pretty confident that this is not connected&nbsp; to any JS within our codebase. There are no abnormal errors in the browser JS console. It also appears to be more prevalent when I first load a game, and then improves slightly after I've played around for a while. In particular, if I import a monster from the Compendium, then delete it and import it again, it often starts working. This suggests to me that there may be a latency/race-condition issue somewhere that is sometimes masked either by caching or by the app being less CPU-bound after some initial processing has been done. The only interesting difference that I can see in the console is that the first time around it spends quite a while attempting to load the image for the compendium entry: <a href="https://s3.amazonaws.com/files.d20.io/images/26298545/as4phzTXqlMjYpq-LAM_nQ/med.jpg?1481746864" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/26298545/as4phzTXqlMjYpq-LAM_nQ/med.jpg?1481746864</a> [HTTP/1.1 304 Not Modified 1555ms] It's kind of worrying that a 304 is taking 1.5 seconds to come back from S3; perhaps that extra delay is pushing the client over the edge into giving up on populating the data? I will continue to try and establish some clearer criteria for when this happens, but it would be great if the dev team could take a look at the changes made for the most recent update in the area of compendium-&gt;sheet integration and see if there are plausible candidates for where there might be e.g. a timeout that might result in the client giving up on completing the compendium data load.
1530116302
Lucian
Pro
API Scripter
TheAaron helped me do a little more testing on this (thanks Aaron!). He has a similarly specced laptop to me, but a much faster internet connection (&gt; 10x + it's on the right side of the Atlantic). Testing on the same game, he doesn't see this issue at all, but I get it reliably every time. It looks like there's clearly a latency issue that may somehow exacerbated by the size and complexity of the character sheet (I haven't seen a problem with the OGL sheet so far). To reproduce, I'd suggest using the throttling tools in chrome and then doing the following: Create a new game with the Shaped Sheet from the drop-down Drag a monster from the compendium (e.g. Lich) Take note that the created character sheet is pretty much unpopulated Repeat the experiment with the throttling turned off and note that the issue disappears
1530118351
Lucian
Pro
API Scripter
Oh man, so it's even weirder than previously thought. I just tried with a VPN (even higher latency) - and now it generally seems to work. The fact that it sometimes works without the VPN suggests to me that this is probably not an ISP connectivity issue, but instead some sort of race condition that is partially dependent on network responses.
1530120689
Lucian
Pro
API Scripter
Spoke too soon. VPN stopped making any difference now. Also tried on Chrome, still the same. It looks like it really is deeply non-deterministic. Sorry :-(
1530123152
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Anything we can do to help test, Lucian? Any specs you need or tests performed?
1530126700
Lucian
Pro
API Scripter
keithcurtis said: Anything we can do to help test, Lucian? Any specs you need or tests performed? Hey Keith, Really at this stage the most useful thing you can do is to comment on this thread if you see the issue - including details about what sort of connection you were on when it happened. So far it's unclear to me what the scope of the problem is since the only person who has definitely seen it is me - but it happens pretty consistently for me at the moment.
1530127831

Edited 1530127918
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I have no problem dropping equipment onto a character, nor importing a character using the script. However, If I drag a new monster from the compendium onto the tabletop, it wants to import as a PC, and doesn't fill out any fields to speak of. Dragging the Compendium creature ontot he character sheet once set to NPC set it up fine. I almost never drag a creature from the compendium as part of my setup process, so I am not sure if the weird behavior in the second case above is unusual or due to a campaign setting. In any case, I am not seeing any different behavior on Shaped from what I am used to. Mid-level iMac, 104 Mbs down, 6 up, 9ms ping.
1530128161
Lucian
Pro
API Scripter
keithcurtis said: I almost never drag a creature from the compendium as part of my setup process, so I am not sure if the weird behavior in the second case above is unusual or due to a campaign setting. Hi Keith, Yes, this is unusual and it did work correctly until yesterday. Your connection is pretty good - and I've heard from someone else as well with a good connection - so it looks like latency is *not* directly a factor. Instead it seems like some people "get lucky" and other don't. For whatever reason Aaron doesn't seem to get the issue, but you guys do... Whatever, it seems like something somewhere is very definitely broken.
1530128822
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hm. I just updated the script and a straight fresh monster drop to the tabletop is working properly now.
I do not think it is a latency issue Once the issue was reported this morning I wanted to see if I had the same issue on one of my games. I am using a desktop with the following specs i7-8700k CPU 3.70GHz 16GB RAM Windows 10 A pair of AMD R9-290 Graphics cards Spectrum 100Mbps internet that has an average ping of approximately 25ms most of the time and I had the same problem.&nbsp; If I pull a monster that I do not have in my journal directly onto my VTT from the compendium it behaves just as @keithcurtis describes. If I then attempt to pull the same monster onto the same character sheet it correctly imports the monster. NOTE: I have not changed the sheet from PC to NPC.
I doubt it's latency unless it's on the Roll20 end.&nbsp; I'm getting the same problems trying to drag critters from the compendium on to the map. I always drag directly from the compendium and it works great; however, today when I drag from the compendium the sheet (shaped) stays on PC instead of switching to NPC and none of the stats or information is updated on the sheet.
OK I logged out and back in after seeing Keith's message above and now it appears to be working correctly for me.
1530135693
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Lots of changes to the underlying code coming fast and hard today. I wouldn't be surprised if behavior fluctuates wildly.
Yeah I'm having the same problem again.&nbsp; Pretty frustrating.
I concur that it is a hit and miss issue. I have been playing with a fresh campaign and have pulled in 8 different types of Kobolds from the compendium. On 5 of them everything worked fine. On 3 of them I ended up with blank character sheets.&nbsp;
1530179939

Edited 1530179975
Ambitosis
Marketplace Creator
I'm having this issue in a brand new game, but not in our Tomb of Annihilation game. They're using the same sheet version. Infuriating. Every new monster I drag onto the canvas is blank, but the solution (thanks OP!) of dragging the monster into an existing sheet still works just fine.
Hi everyone! I have submitted a ticket to the devs who will have a look. As said earlier, reproduction seems to be sporadic so whatever additional information anyone can provide is surely to be appreciated! Console logs, OS, browser being used, extensions, character sheet are all relevant information!
1530260471
Lucian
Pro
API Scripter
Drespar said: Hi everyone! I have submitted a ticket to the devs who will have a look. As said earlier, reproduction seems to be sporadic so whatever additional information anyone can provide is surely to be appreciated! Console logs, OS, browser being used, extensions, character sheet are all relevant information! Hey Drespar, I will try and post some console logs later, but this is what I know so far: For me happens in both Chromium (no extensions) and Firefox - everything except Kee (password manager) switched off - but this has never caused a problem in the past. Can you try disabling everything to be sure but I would be very surprised if this is a factor I'm on Linux, but we've also had Windows and probably MacOS as well from other users This shows up on the 5e Shaped Character Sheet - and I think pretty much all of the people chiming in here are using Shaped - but as I mentioned in my original post, you can start butchering the sheet - up to and including removing all the sheetworkers - and you can still see this behaviour, albeit less often/reliably. Cheers, Lucian
This is still a recurring issue today as I just tested it again for myself.&nbsp; I am using Chrome and have tried firefox. Only extensions are Adblock on both. Windows 7 OS and I am using the 5e Shaped Character sheet.&nbsp;
1530904606
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Lucian said: This shows up on the 5e Shaped Character Sheet - and I think pretty much all of the people chiming in here are using Shaped - but as I mentioned in my original post, you can start butchering the sheet - up to and including removing all the sheetworkers - and you can still see this behaviour, albeit less often/reliably. There are similar reports elsewhere from folks (They don't always identify the sheet), that dropping a monster onto the map from the Compendium results in a mostly blank character sheet, but dropping the monster again , onto the open character sheet populates all fields correctly. Question: When I drag a monster from the Compendium, is the expected behavior a sheet set to PC or NPC? I'm getting a PC every time, which I suspect might be related to the problem.
1530910879
Lucian
Pro
API Scripter
keithcurtis said: Question: When I drag a monster from the Compendium, is the expected behavior a sheet set to PC or NPC? I'm getting a PC every time, which I suspect might be related to the problem When the issue occurs the Compendium data is never actually populated into the sheet at all, so none of the sheet logic is triggered. Part of the Compendium drop processing is switching the sheet to NPC mode, which is why you're seeing it stay on PC mode.
1530914177
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
That makes sense. Thanks.
1530997941
Lucian
Pro
API Scripter
Ok, so I think I have some new info on this. I'm a little wary of making firm claims here, because the behaviour I'm seeing now seems to be a little different to before, and I can't be 100% sure whether this is because I was&nbsp; confused before and got it wrong, or if the non-determinate nature of this problem is just messing with&nbsp; me in a different fashion. Previously I'd thought that this behaviour was independent of sheetworkers, but I think this may not be the case. What seems to be the issue now is an interaction between the processing done by the sheet in "sheet:opened" and the population of data from a compendium drop. Now this could be pure random luck, but it seems like if I comment out the body of the handler for 'sheet:opened', compendium drop happens correctly every time. If I leave it uncommented,&nbsp; the 'sheet:opened' handler runs and configures some default values (it populates the list of skills, the version number and a few other little bits), but sometimes (most of the time for me) the compendium data simply doesn't get set into the attributes marked to accept it (and consequently none of the sheetworkers triggered by those attributes runs) Experimenting further, the deciding factor seems to be if sheet:opened calls setAttrs at any point - it can read as much data as it likes, but as soon as it writes using setAttrs, the compendium drop never happens. Hazarding another stab-in-the-dark here, I'm wondering if somewhere in the latest update for the charactermancer, some behaviour was changed around sheet initialisation that introduced (or surfaced) a race condition whereby setting compendium data on the character can get suppressed/ignored if the sheetworkers start writing other attribute values as part of sheet:opened? Perhaps on some machines/in some situations the compendium drop starts quickly enough that the problem with sheet:opened doesn't get to suppress it (sheet:opened seems to be the first event that the sheetworkers see)? Any chance that we could get some extra debug logging stuck in around this area on the dev server so that there's a better chance of nailing down exactly what's going on?
This certainly adds some information that could certainly be worth investigating. I will make sure to append this into the existing bug ticket for the devs to check out :) Lucian said: Ok, so I think I have some new info on this. I'm a little wary of making firm claims here, because the behaviour I'm seeing now seems to be a little different to before, and I can't be 100% sure whether this is because I was&nbsp; confused before and got it wrong, or if the non-determinate nature of this problem is just messing with&nbsp; me in a different fashion. Previously I'd thought that this behaviour was independent of sheetworkers, but I think this may not be the case. What seems to be the issue now is an interaction between the processing done by the sheet in "sheet:opened" and the population of data from a compendium drop. Now this could be pure random luck, but it seems like if I comment out the body of the handler for 'sheet:opened', compendium drop happens correctly every time. If I leave it uncommented,&nbsp; the 'sheet:opened' handler runs and configures some default values (it populates the list of skills, the version number and a few other little bits), but sometimes (most of the time for me) the compendium data simply doesn't get set into the attributes marked to accept it (and consequently none of the sheetworkers triggered by those attributes runs) Experimenting further, the deciding factor seems to be if sheet:opened calls setAttrs at any point - it can read as much data as it likes, but as soon as it writes using setAttrs, the compendium drop never happens. Hazarding another stab-in-the-dark here, I'm wondering if somewhere in the latest update for the charactermancer, some behaviour was changed around sheet initialisation that introduced (or surfaced) a race condition whereby setting compendium data on the character can get suppressed/ignored if the sheetworkers start writing other attribute values as part of sheet:opened? Perhaps on some machines/in some situations the compendium drop starts quickly enough that the problem with sheet:opened doesn't get to suppress it (sheet:opened seems to be the first event that the sheetworkers see)? Any chance that we could get some extra debug logging stuck in around this area on the dev server so that there's a better chance of nailing down exactly what's going on?
1531426770

Edited 1531427050
I created a new campaign last week and this issue seems to be preventing me from using the shaped sheet to properly import monsters from SRD. I have used the drag-and-drop, after a guided import, work around and the sheet does populate but some fields are not getting picked up (in my case spell slots numbers). Spells are also getting dropped with the work around. The Bless spell on the Acolyte Sheet for example&nbsp; I hope this is helpful&nbsp; --Mike Just to add, the spells even when manually entering the slots do not update.&nbsp;
Hello,&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;I'm still experiencing this issue and it's starting to become extremely frustrating. I understand there is a work around to fixing the sheets but I would like to know if there is any progress on this bug being fixed. I don't feel as though I should have this issue for the amount of money paid for these manuals. (I've purchased all the monster manuals including Tome of Beasts). I reached out to the support team and reported my issue and sent a list of games that it is occurring in and have yet to hear anything back other than the drag and drop into a new sheet. As a long time user and supporter of this website I feel as though I've been dealt a bad hand with this bug. I do not mean to complain and I understand there are lines of code I can't comprehend but ever since the introduction of the charactermancer my compendium of monsters feels rather useless.&nbsp; &nbsp; &nbsp; If there is anything at all that can be done I'm all eyes and ears to fix this problem because it's becoming almost unbearable. Thanks and sorry for the complaining.&nbsp; This occurs for both the OGL sheets and the shaped sheets and any new game I create.
1533975427
Lucian
Pro
API Scripter
I'd just like to chime in here again - hopefully Drespar or one of the other mods/Roll20 crowd will see this. I used to be (still am??) a software developer and I understand how frustrating these non-deterministic issues are to address - and I know how easy it is to just ignore them and hope they go away. I also know, from bitter experience, that that's&nbsp; a really bad idea, because they're usually a sign that there's something importantly Not Right which is going to come back and bite you in the ass much harder later. There were some similar problems a year or so ago when API sheetworkers were introduced. At the time, Riley was amazingly helpful and worked through the issue with me (see here and here ). He put a bunch of extra logging in on the dev server and I spent a lot of time testing and generating log traces. His willingness both to do this and to explain the structure of what was going on meant that we could work together to nail the issue down. I know how to debug software and I'm very happy to do the same again; since it seems like quite a few users are affected by this issue and it significantly compromises the value of a bunch of paid offerings on Roll20 for them it would be great if we can make some progress towards resolving this.
Both T and Lucian you are totally right that this can become a huge pain point, and this is something still definitely on our radar. To speak a bit more plainly, we are aware of issues regarding JSON and CORS errors coming from drag and drop and are working to investigate, collect more information, and resolve that issue as it has been cropping up more (both in forum and via email). The hope is that pinning down this issue will result in better drag and drop experience across the board as we try and nail down the underlying cause. T, in more direct response to your statement about email, I was able to find it and will be reaching out via that medium to continue our conversation. You have my apologies as it had slipped through the cracks with conventions and other events during that time.
1534004157
Kryx
Pro
Sheet Author
API Scripter
Thanks for the update Drespar and thanks for looking in to this issue as I'm sure many people will appreciate it if the problem can be solved.
1534017965
Lucian
Pro
API Scripter
Hey Drespar, Thanks for the update - it's good to know that this is actively on the radar. Let us know if there's anything that we can do to assist with testing/data collection.