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

Strange error kills sheet

1459959701
Lucian
Pro
API Scripter
Another odd one that I haven't got exact reproduction criteria for yet, but sometimes after I've removed all the attributes for a character via the API, the next time I go back into the sheet and do something that should trigger a sheetworker, it dies with this error: app.js?1459866443:32 Uncaught TypeError: Cannot read property 'page' of undefined (anonymous function) @ app.js?1459866443:32 t.Events.trigger @ base.js?1457455522:1 n.extend._onModelEvent @ base.js?1457455522:1 t.Events.trigger @ base.js?1457455522:1 n.extend.change @ base.js?1457455522:1 n.extend.set @ base.js?1457455522:1 n.extend.save @ base.js?1457455522:1 d20.models.AttributeModel.Backbone.Model.extend.syncedSave @ app.js?1459866443:37 d20.models.CharacterView.Backbone.View.extend.saveSheetValues @ app.js?1459866443:37 (anonymous function) @ app.js?1459866443:36 p.event.dispatch @ jquery.1.8.2.min.js:2 g.handle.h @ jquery.1.8.2.min.js:2 Somehow that sheet in an inconsistent state from which it doesn't recover until I refresh the campaign/delete it and start again.
1459971655

Edited 1459971688
Phil B.
Forum Champion
Sheet Author
This sounds like something that might happen. Can you give me a  gist of a trimmed down version of your API code so that I can reproduce this on my own machine.
1459977662
Lucian
Pro
API Scripter
Hi Phil, With this and the other bugs I've raised they seem to happen more often with characters with lots of attributes, so you probably need to have some good test data. I'll PM you so more details.&nbsp;I've made a gist here:&nbsp; <a href="https://gist.github.com/symposion/5da32baf5394f34d" rel="nofollow">https://gist.github.com/symposion/5da32baf5394f34d</a>... that captures the basics of what the API was doing, but obviously there are a lot of complex interactions between the script and the sheet and the sheetworkers, and I'm not sure which parts are relevant. Lucian
1460071733
Phil B.
Forum Champion
Sheet Author
This shows how you are adding the attrs, how are you going about deleting all of them to cause the error.
1460096695
Lucian
Pro
API Scripter
Hi Phil, Line 8:&nbsp;_.invoke(oldAttrs, 'remove'); Lucian
1460135601
Phil B.
Forum Champion
Sheet Author
Oh yup, don't know how I missed that. Thanks