BoldSign®Effortlessly integrate e-signatures into your app with the BoldSign® API. Create a sandbox account!
Hello.
Have you been able to resolve Bug #903791?
I'm encountering an issue with the if clause:
if (entry.type === 'EndGroup' && diagram.historyManager.currentEntry.type === 'StartGroup')
The following error appears:
ERROR TypeError: Cannot read properties of undefined (reading 'type') at UndoRedo.addHistoryEntry
Maybe replacing it with:
if (entry?.type === 'EndGroup' && diagram?.historyManager?.currentEntry?.type === 'StartGroup')
could be the solution.
Thank you!
Hi,
We are unable to understand the details you provided regarding the issue. Could you please provide more information about the issue and the ID (903791) you mentioned in your query is not a valid feedback or support id.
Regards,
Dhakshin
Hello.
I was getting an error in the following if clause on your code, and it is mentioning the bug 903791:
UndoRedo.prototype.addHistoryEntry = function (entry, diagram) {
// Bug: 903791-remove StartGroup & EndGroup entry when no actual changes wrapped between them.
if (entry.type === 'EndGroup' && diagram.historyManager.currentEntry.type === 'StartGroup') {
if (diagram.historyManager.currentEntry.previous) {
diagram.historyManager.currentEntry.previous.next = undefined;
}
diagram.historyManager.currentEntry = diagram.historyManager.currentEntry.previous;
// when cancelled change startGroup is only entry in history manager
if (!diagram.historyManager.currentEntry) {
diagram.historyManager.canUndo = false;
}
return false;
}
var entryObject = null;
var nextEntry = null;
....
Hi,
We have received a support ticket from your account. Could you please confirm if both ticket and forum have same query? If not, kindly provide the sample and the replication procedure for the issue.
Regards,
Dhakshin
Unfortunately, I cannot reproduce the same error, but I have been able to reproduce similar ones. In the following example,
https://stackblitz.com/edit/syncfusion-diagram-historymanager-undo-redo-lzznlkzc
if you click JOIN, then click UNDO twice, and then click REDO once, the following error appears:
ERROR TypeError: Cannot read properties of null
at UndoRedo.redoGroupAction
at UndoRedo.redo
at Diagram.redo
And if you enter this example:
https://stackblitz.com/edit/syncfusion-diagram-historymanager-undo-redo-7mjsztpa
just click JOIN and then click UNDO to see this other error:
ERROR TypeError: Cannot read properties of null (reading 'type')
at UndoRedo.undoGroupAction
at UndoRedo.undo
at Diagram.undo
All these errors originate from the use of the HistoryManager and are not related to ticket #675038.
Hi,
We will validate the issues and get back to you soon.
Regards,
Dhakshin
Hi,
We provided a solution during the meeting held on January 7, 2025. Could you please confirm whether that solution resolved the issue? If not, kindly provide us with an update.
Regards,
Dhakshin
Hello.
This error is not related to our meeting on January 7.
Check what a wrote on December 27, 2024.
Regards.
Hi,
We have validated the issue you mentioned using the samples you provided. During our review, we noticed the following:
startGroupAction
method is called twice in Sample 1.endGroupAction
method is called twice in Sample 2.To address this, we have modified the samples by removing the redundant method calls and added logic to restrict undo and redo actions while executing join method actions.
Please refer to the updated samples below for your reference:
Sample 1: Undo/Redo Issue Fix - Group Action Start
Sample 2: Undo/Redo Issue Fix - Group Action End
Regards,
Dhakshin