Hello Bryntum team!
We are experiencing some inconsistencies regarding the undo/redo and the changes available in the crudManager.
That happens when we don't perform a crudManager.acceptChanges();
Basically, if I move a scheduled event to a different timeline, the Undo / Redo will always trigger new changes in the crudManager.
But the same doesn't happen when scheduling / unscheduling events.
We just perform a crudManager.acceptChanges() after receiving a valid reply from the server.
Our server has a set of validation process that is triggered when it receives a new Change from the STM, so if the user performs multiple changes in a very short period, the server interrupts the running validation and starts new validation considering the latest changes received (which is an accumulated set of changes).
The fact that Undo is not triggering changes means that even though the Previous action was undone, it won't send that information to the server.
Supposing the server take 5 seconds to validate a Scheduling action:
Drag Unscheduled event to scheduler => Trigger STM => there are crud changes => send to server
Server starts validation of the scheduled changes...
Undo is Clicked right after => Trigger STM => no changes in crud => nothing is send to the server
With that, after 5 seconds the server will finish the validation and apply the Scheduling action to the db. Which is wrong as the user clicked Undo for that action.
If we consider the same case but moving scheduled events to a new timeline:
Drag scheduled event from 5AM to 6AM => Trigger STM => there are crud changes => send to server 6AM
Server starts validation with the 6AM change...
Undo is Clicked right after => Trigger STM => there are changes => send to server 5AM
Server receives new change with 5AM, will interrupt the running validation and start a new validation with the most recent changes (5AM)
Follow attached a snippet and source code using drag-from-grid as a starting point.
You can see the logs are different when Undoing a Scheduling action compared to a Drag already scheduled event to a new timeline