Our state of the art Gantt chart


Post by mrefaat »

When adding multiple subtasks I get these errors provided in the screenshots.
you can use this project " Sub Tasks " to test

Attachments
rarely I get this error
rarely I get this error
subtask2.PNG (58.89 KiB) Viewed 320 times
this one I get the most
this one I get the most
subtask.PNG (54.98 KiB) Viewed 320 times

Post by Maxim Gorkovsky »

This problem seems to be a race condition, and I don't see how it could be related to our code. This message shows as an exception handler from the attempt to sync with the backend.

What I noticed is that if I stay in the debugger longer, requests seem to execute just fine. Provided your handlers are organized in a setInterval, I would suggest revisiting that logic and checking if execution order is correct.


Post by mrefaat »

The issue in the sequence of triggers being updated. It should send an update event for the tasks being updated before the on add event to avoid having a state of duplicate WBSs.
I’m trying to buffer the update records and executing them at once which should solve the problem in theory.

I think the Gantt should send the update events first for all the records to be updated and then the add event


Post by Maxim Gorkovsky »

I think the Gantt should send the update events first for all the records to be updated and then the add event

What if you add a new item to the tree and then move existing record to it. Then you have a link to non-existing record. Usually new records are processed first, and updates - after.

I would strongly recommend getting rid of combination of setInterval and setTimeout to check for a state and sync smth to the backend. That is impossible to control and very difficult to debug. You can use store events to get updates, or one on the project: https://bryntum.com/products/gantt/docs/api/Gantt/model/ProjectModel#event-hasChanges You can create a buffered function which can be triggered multiple times, but will be called after a certain timeout: https://bryntum.com/products/gantt/docs/api/Core/helper/FunctionHelper#function-createBuffered-static


Post by mrefaat »


Post by Maxim Gorkovsky »

What do you mean by this? Do you get a 404? Broken page or what?
This link is supposed to open a doc page about FunctionHelper and later scroll to the section "createBuffered". You can also use text search and filter fields to find this method.


Post by mrefaat »

This is what I get
Oops, we could not find this resource
Core/helper/FunctionHelper could not be found.


Post by Maxim Gorkovsky »

To see it you need to enable "Show Internal members"

Screenshot 2024-08-12 181500.png
Screenshot 2024-08-12 181500.png (18.46 KiB) Viewed 246 times

In general, we do not recommend using internal API, although this one is stable enough. And when you get the source code you can implement a similar function.


Post Reply