dxwarlock / Roll20

Roll20Files
3 stars 10 forks source link

Consider replacing .setWithWorker with .set #4

Open symposion opened 7 years ago

symposion commented 7 years ago

Hi, I'm the author of the Companion script for the 5eShaped sheet. There's what looks like a Roll20 bug with api sheetworkers at the moment when two scripts both do setWithWorker on campaign startup. I have reported this to Riley, but in the meantime, I've got quite a few bug reports from users who are using both your and my script. Looking over your code, it seems like the attributes you are setting are custom attributes for use by your script, that will never be processing by sheetworkers. If this is the case, it would be preferable to just use the ordinary "set" method; it will result in less redundant work by the API server and will also help to avoid the conflict that I'm seeing until Roll20 get round to fixing the bug at their end.

Happy to go into more detail if needed...

dxwarlock commented 7 years ago

Ah no problem at all. I had it as set() But TheAaron suggested sheetworker (in case some reason it was ever needed) Be more than happy to change it. I'll do that today. Also you found the bug that was DRIVING me crazy about the destroy! I bet I've read it 50 times and didn't notice that.

dxwarlock commented 7 years ago

See if this update helped. Changed .setWithWorker to just .set

symposion commented 7 years ago

Cool, thanks! Will have a play in the next few days to see if that changes the behaviour as I expect!