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).