Our pure JavaScript Scheduler component


Post by isilogplan »

Hello, I'm using Scheduler Pro 6.2.2 and I'm facing an issue when reloading the project while a group resource is collapsed.

It seems very similar to this bug: https://github.com/bryntum/support/issues/2858, which appears to have been fixed in 2021. However, the issue still occurs for me — I get the following error:

Error: Unknown identifier ModelClass-314.$.version

To provide more context, here are some relevant parts of my app:

In my resource column, I've added a combo box in the header which reloads the project when changed. The error happens only when a group is collapsed at that moment.

            columns: [
                {
                    type: 'resourceInfo',
                    showEventCount: true,     
validNames: null, editor: false, sortable : false, filterable:false, headerRenderer({ column } : any) {
column.headerWidgets = [{ type : 'combo', editable : false, items : [{ value : 0, text : 'Teams' }, { value : 1, text : 'Agendas'}], value: 0, onAction(props : any) { const params = { resourceType : props.value, }; scheduler.project.reloadData(params) } }]; }, }, ],

In the reloadData() function, I start by cleaning all entities and stores using these methods (perhaps this extra cleanup step is triggering the bug that was supposedly fixed?):

        project.replica?.removeEntities([
          ...project.resourceStore.records,
          ...project.assignmentStore.records,
          ...project.eventStore.records,
          ...project.dependencyStore.records,
          ...project.calendarManagerStore.records,
          ...project.timeRangeStore.records,
          ...project.resourceTimeRangeStore.records
        ]);
      
project.resourceStore.removeAll(); project.assignmentStore.removeAll(); project.eventStore.removeAll(); project.dependencyStore.removeAll(); project.calendarManagerStore.removeAll(); project.timeRangeStore.removeAll(); project.resourceTimeRangeStore.removeAll(); }

After that, I simply call project.load(), and that's when it crashes.

Is there a workaround to prevent this error, or could this be a different variation of the bug I linked above?

Thanks!


Post by ghulam.ghous »

Hey there,

Can you please share a minimal runnable test case with us? So we can run it and debug it, you can download or use any of our online example and add the minimum code required there.

Why do you need to clear the stores at replica level though?


Post by isilogplan »

Thank you for your quick response.

In the meantime, I’ve identified the real cause of the problem: it is indeed the cleanup step of entities and stores that was triggering the error.

To answer your question — the reason I initially added that cleanup step is because, when calling the load method on the project, I encountered the following error:
Error: Already entered replica.
I couldn't determine where this error was coming from, and the only workaround I found at the time was to clear everything before reloading.

However, while working on the test project, I discovered the actual issue: if a resource belongs to multiple groups and the project is reloaded, the error occurs.
This is the true root of the problem — without the cleanup step, the initial error when groupment were collapsed doesn’t happen.

I’ve prepared a small test project so you can reproduce the issue.

As you can see in the test project data, there is a resource belonging to multiple groups:

{
  "id": 1,
  "nomRessource": "USER1DOUBLE",
  "groupeRessource": [
    "GROUP1",
    "GROUP2"
  ]
}

When I change the value in the resource combo, it triggers project.load()Error: Already entered replica.
If I remove "GROUP2" from the resource and do the same, the error does not occur.

Let me know if you’re able to reproduce the issue. Thanks!

Attachments
test.zip
(20.17 KiB) Downloaded 5 times

Post by ghulam.ghous »

Thanks for sharing the test case and this indeed looks like a bug on our end. Here is the ticket: https://github.com/bryntum/support/issues/11383. You can subscribe to the ticket to keep track of updates.


Post Reply