Hello everyone,
I want to create an event on the schedulerPro, but I don't want to follow the classical flow of the schedulerPro changes, here is the flow that I want to follow :
A schedulerPro event triggers some changes, these changes are sent to a backend server that processes the changes and sends back the data to the frontend. The frontend then handles the changed data in a redux store, and then the changes are applied to schedulerPro eventStore, assignmentStore and resourceStore dependening on the nature of the changes (update, delete, create).
But when I want to add an event in the eventStore using eventStore.add, the first time, the first element of the eventStore records disappears on the UI (though still being on the
eventStore data), and for every other time after the first one, the last created event disappears (again only on the UI).
Let's take a set of 4 events as an example {A, B, C, D} :
When I try to add event E on scheduler (1st time), A dissapears after E is added.
Then when I try to add event F on scheduler (2nd time), E disappears after F is added.
Then when I try to add event G on scheduler (3rd time), F disappears after G is added.
And so on...
And whenever A, E and F dissapear on the UI, they are still visible on the logs of the eventStore data.
Here is the code I used to handle the adding of an event; I take the project ref and the changedData as parameters, I extract propper event and assignment data from it, and then I add in both stores :
const handleEventAdd = (project, data) => {
const { assignmentStore, eventStore } = project.current.instance;
eventStore.add(getEvents(data));
const assignments = getAssignments(data);
assignmentStore.add(assignments);
};
My question is the following : Is there something wrong in my way of adding an event, or is there a bug that causes this situation ? I have been looking for alternatives for the past 2 days (that all implied the eventStore.add in the end) and all the alternatives pointed to the same problem quoted above (i.e dissapearing of events).
NB : I use the id field as the id of an event and it's a large number, not a string (maybe that piece of information can help).