DataFlowAnalysis/WebEditor

Multiple assignments cause an error in the editor

Closed this issue · 5 comments

Currently, there is an error message in assignments like these, although they are legal:

forward data
set Encryption.Encrypted = TRUE
set Sensitivity.Personal = FALSE

Hopefully, this is only a regex problem (which would be easy to fix) and not a model problem (which would be hard to fix).

Update: The json file seems to be correct, so probably a display problem only.

"behavior": "forward data\r\nset Encryption.Encrypted = TRUE\r\nset Sensitivity.Personal = FALSE",

@Nicolas-Boltz (employee of the month) already found the problem:

const lines = behaviorText.split("\n");

Was the diagram generated through some other tool or created in the editor?
\r\n should not happen in web contexts and when testing this on linux and windows with the editor none produce \r\n, only \n as expected.

Nice to see you are still following what is going on in the repository :).
This even occurs when opening the default model in the editor and simply adding a 'set' statement to an existing behavior, like, for example, the output pin of 'display'.
@sebinside and I both get this error.

Can't reproduce this right now but will test again this weekend with other browsers/devices when I hopefully have a bit of time.
Changing the validation to handle \r\n works but avoiding \r in the first place would be nicer imho. Maybe this is configurable in monaco and by default auto-decides on some rule. Will check on that.

Was now able to reproduce this and will implement the proposed fix through setting End-of-Line in monaco to only be \n