Page 1 of 1

AutoSync and Undo Issues

Posted: Thu May 26, 2022 9:20 pm
by dwr

We have Undo/Redo set up on our app and we're persisting data to a backend. We've set autosync true. We're seeing two separate Undo issues:

1) When we create a task the undo count goes up by 1. When the sync request completes and the phantom task ID is replaced by a real task ID, the undo count goes up by 1 again. It doesn't make sense to us that these sync response changes (phantom to real IDs) are undoable. Is that a bug, or is there some way to filter this action out of undo?

2) When we undo the creation of a task, the task is removed from the UI, but no sync request is sent. This seems like a bug. With autosync on, other undo actions are persisted, but not the undo of create.


Re: AutoSync and Undo Issues

Posted: Fri May 27, 2022 7:34 am
by arcady

Yes we are aware of some issues when using undo/redo with a backend. That's why we added to the docs a recommendation to reset the undo/redo queue:

Note: STM currently does not support undoing server side added and saved records. Therefore it's recommended to reset the queue each time a tracked store(s) loads from or saves its changes to the server.

That just was the easiest approach to solve that sort of issues. Recording of id changes indeed looks not making any sense so I've made a ticket for your case: https://github.com/bryntum/support/issues/4681
Thank you for the report!