Premium support for our pure JavaScript UI components


Post by Robert Hirst »

Hi,

I'm posting this as a info req, because I'm not completely sure whether it's a bug in the Scheduler or whether I'm just doing something which I shouldn't.

When my page loads, I begin an asynchronous load of a large dataset, and subscribe to a messaging channel for realtime updates.

Since the main dataset can have 2-3k complex events, it takes about 10-30 seconds to load, so it's possible that real time events concerning the data in that initial load might arrive, and be more up to date that the data in the initial load.

I run the main load in a batch, and before each update operation (from main batch or real time) I determine if the record was already created, and either ignore it (for the main load, as it must have changed since load) or update the record (for real time events).

Occasionally, and usually after ending the batch I'm seeing the following in the javascript console:

core.js:6014 ERROR RangeError: Maximum call stack size exceeded
    at EventModel.set resource [as resource] (scheduler.module.js:108456)
    at AssignmentStore.assignEventToResource (scheduler.module.js:99270)
    at EventModel.applyResourceId (scheduler.module.js:108492)
    at EventModel.set resourceId [as resourceId] (scheduler.module.js:108466)
    at EventModel.set resource [as resource] (scheduler.module.js:108456)
    at AssignmentStore.assignEventToResource (scheduler.module.js:99270)
    at EventModel.applyResourceId (scheduler.module.js:108492)
    at EventModel.set resourceId [as resourceId] (scheduler.module.js:108466)
    at EventModel.set resource [as resource] (scheduler.module.js:108456)
    at AssignmentStore.assignEventToResource (scheduler.module.js:99270)

It looks like a recursive stack overflow purely in the Scheduler code, but I am not sure if something I'm doing is causing it, or it's a bug.

Getting a repro is going to be tough on this one, hence not raising as a bug, and I can't make it happen consistently in my own code, so I'm wondering if it would be possible to request a code review of the assignEventToResource method, to see if a potential recursion problem can be identified using the stack trace above.

I have a few ideas to improve my initial load times, such as loading in chunks or buffering the real time changes until the initial load, I'm worried that there's a deeper issue here which might get missed.

Many thanks for your time, and I'm so far getting on well with v4. Overall it seems to perform much better for my case, and I've even been able to begin using animations again (in v3 my custom renders were much slower and caused animation issues, but they've fine since refactoring to closer match the latest nested event demo).


Post by alex.l »

Hi Robert Hirst,

Ideally, we need a test case and ability to reproduce the issue to investigate it. Could you please show us the code how do you load your data and configs you applied to your Project? Maybe it help us to go forward in this problem.

All the best,
Alex

All the best,
Alex


Post by Robert Hirst »

OK, I think I have repro, modification to the bigdataset example, randomizing assignments for 50 events by setting resourceId via setInterval.

app.js
(8.27 KiB) Downloaded 114 times

It does say in the upgrade guide that single assignment using resourceId is still supported.. I haven't checked whether updating the assignment in the assignment store alleviates the issue, but that's probably my next step.


Post by alex.l »

Thanks for your test case, I was able to reproduce this, we will investigate the problem, here is a ticket to track: https://github.com/bryntum/support/issues/1996

All the best,
Alex

All the best,
Alex


Post by anacoda »

I am having the same problem occasionally when dragging an event between resources. Is there any update?


Post by tasnim »

Hi,
We will consider it for one of the 5.x.x patch releases.

Please let us know if you have any other questions.
Good Luck :)


Post by peterjc »

I had a user receive (just once) a RangeError: Maximum call stack size exceeded. Am now trying to reproduce / work out what caused it


Post Reply