Our pure JavaScript Scheduler component


Post by nAi »

Hi.
I'm reloading the data from backend server with

this.$refs.scheduler.schedulerInstance.eventStore.load({ startDate, endDate })

and sometimes onBeforeRemove event is fired containing all records (!). This was working fine before 4.2.x version. What could be the reason why this event is fired?


Post by mats »

How can we reproduce it?


Post by nAi »

I tried to reproduce it in https://bryntum.com/examples/scheduler/php/ example simply by adding onBeforeRemove event listener, but could not reproduce it. Could you check my config file, if there is some misconfiguration with new 4.2.x Scheduler version? With version 4.1.4 everything is working fine.

Attachments
schedulerConfig.js
(28.06 KiB) Downloaded 65 times

Post by saki »

There is nothing obvious that would be wrong in your code and there was no breaking change in our code since 4.1.x in this area (https://www.bryntum.com/products/scheduler/changelog/). Ideally, we would be able to reproduce it ourselves in a runnable showcase.

Meanwhile, you can try to debug it yourself by setting a conditional BP in your onBeforeRemove handler and follow the call stack that led to the erroneous arguments. Check also removingAll flag please (https://bryntum.com/docs/scheduler/#Core/data/mixin/StoreCRUD#event-beforeRemove) as it can give a clue what's happening.


Post by nAi »

Not sure if I did this right. Does this help?

onBeforeRemove (c:\dev\boqa-app-update\src\components\Scheduler\schedulerConfig.js:629)
callback (c:\dev\boqa-app-update\node_modules\@bryntum\scheduler\scheduler.module.js:2846)
trigger (c:\dev\boqa-app-update\node_modules\@bryntum\scheduler\scheduler.module.js:5758)
trigger (c:\dev\boqa-app-update\node_modules\@bryntum\scheduler\scheduler.module.js:110560)
trigger (c:\dev\boqa-app-update\node_modules\@bryntum\scheduler\scheduler.module.js:114257)
remove (c:\dev\boqa-app-update\node_modules\@bryntum\scheduler\scheduler.module.js:23180)
remove (c:\dev\boqa-app-update\node_modules\@bryntum\scheduler\scheduler.module.js:27857)
remove (c:\dev\boqa-app-update\node_modules\@bryntum\scheduler\scheduler.module.js:118181)
syncDataset (c:\dev\boqa-app-update\node_modules\@bryntum\scheduler\scheduler.module.js:27553)
setStoreData (c:\dev\boqa-app-update\node_modules\@bryntum\scheduler\scheduler.module.js:29260)
setStoreData (c:\dev\boqa-app-update\node_modules\@bryntum\scheduler\scheduler.module.js:110602)
set data (c:\dev\boqa-app-update\node_modules\@bryntum\scheduler\scheduler.module.js:29178)
set data (c:\dev\boqa-app-update\node_modules\@bryntum\scheduler\scheduler.module.js:114243)
set data (c:\dev\boqa-app-update\node_modules\@bryntum\scheduler\scheduler.module.js:114433)
<anonymous> (c:\dev\boqa-app-update\node_modules\@bryntum\scheduler\scheduler.module.js:31029)
<anonymous> (c:\dev\boqa-app-update\node_modules\@bryntum\scheduler\scheduler.module.js:30971)
Promise.then (Unknown Source:1)
eval (c:\dev\boqa-app-update\node_modules\@bryntum\scheduler\scheduler.module.js:30946)
internalLoad (c:\dev\boqa-app-update\node_modules\@bryntum\scheduler\scheduler.module.js:30901)
load (c:\dev\boqa-app-update\node_modules\@bryntum\scheduler\scheduler.module.js:31027)
loadEvents (ProjectScheduler.vue?61b8:462)
....

syncDataset (c:\dev\boqa-app-update\node_modules\@bryntum\scheduler\scheduler.module.js:27553)

// Add and remove, will trigger if below threshold/no threshold
// We cannot simply splice into our Collection because of the extra
// processing various Store mixins do in add and remove implementations

me.remove(toRemove);

The event object contains only store, resources and type. I can't see "removingAll" flag?


Post by saki »

I'm afraid the error stack is not useful – we do not want to guess what could be wrong. Post please a simplest possible runnable showcase that would demonstrate the error. That is a code that we can drop somewhere on the disk and actually run (npm run serve), load the data and see the problem.

We will also need data that is loaded when the error happens.


Post by nAi »

This problem still exists with latest 4.3.6 and 5.0.0-alpha-1 versions. Unfortunately I'm not able to create simplest possible runnable showcase, since I do not know what is the reason for this issue and what to include. The application is quite complex. Upgrade from 4.1.4 version is needed, since end users are complaining about known bug: "Fixed #2991 - Events disappear after scrolling" https://github.com/bryntum/support/issues/2991


Post by alex.l »

Hi nAi,

You provided not really enough info to know what's going on.
I can suppose the problem in https://www.bryntum.com/docs/scheduler/api/Core/data/mixin/StoreSync#config-syncDataOnLoad which is true for all wrappers by default, but only for few latest versions, to make possible using data binding. Try to set it false?

    eventStore: {
         syncDataOnLoad : false,
         // ....

So, when you load new dataset into the store, old records which shouldn't persist in the store anymore, will be removed.
If you need this functionality and want to keep that flag on true, better to listen some user action events instead of store's 'beforeRemove'.

All the best,
Alex


Post by nAi »

Hi Alex,

Thank you for the help! Looks like setting syncDataOnLoad to false removes the problem.


Post Reply