You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "danielzhe (via GitHub)" <gi...@apache.org> on 2024/07/17 22:37:05 UTC

Re: [I] Performing the `undo` operation after reseting the expressions crashs the new DMN Editor [incubator-kie-issues]

danielzhe commented on issue #1182:
URL: https://github.com/apache/incubator-kie-issues/issues/1182#issuecomment-2234481146

   It looks like we have two issues: the one you reported, which I'm able to get a stable reproducer and a new one. The new one gives us the error ""message": "A node Icon must exist for all types of node""
   
   I think I found the root of the one you reported, but I need to investigate a bit more to find the root of the second one.
   
   **To reproduce the error you reported, the steps are the following:**
   1. Open a Context or any iterator expressions (`for`, `every`, `some`, and probably `filter`). **The error does not happen with function and in Context Expressions it only happens in the result**
   2. Set a nested expression something like a Decision Table
   3. Type something in the Decision Table
   4. Reset
   5. Add a Literal Expression
   6. Type something
   7. Undo
   
   The issue is that idRandomizer [here](https://github.com/apache/incubator-kie-tools/blob/c3fabfe3a0914e6d43fc17068027298518249769/packages/xml-parser-ts/src/idRandomizer.ts#L128 ) is trying to set a property called ´@_id´ in a readonly object. 
   
   This is caused because when we reset the expression in `for`, `every`, `some`, and `context`, we set its nested expressions as an empty child with only `expression` as `undefined`. In `Function` we don't do that: we preserve the `@_id`.
   
   Notice in `context` as we handle different reset result and reset entry, [here](https://github.com/apache/incubator-kie-tools/blob/c3fabfe3a0914e6d43fc17068027298518249769/packages/boxed-expression-component/src/expressions/ContextExpression/ContextExpression.tsx#L378).
   
   I'm not sure yet why this is happening only when undo/redo. I got the same error with "redo" too. Still investigating.,
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org