open-scd
open-scd copied to clipboard
Name check in checkUpdateValidity cause strange behaviour when using complex action
In the Substation Wizard we now use the Update Action to change the element instead of Replace Action. The Update Action will hold all attributes that need to be preserve, including the name attribute. There is already a check added to checkUpdateValidity (Editing.ts) to only check the name in case they are different (old <-> new).
When the check is executed and the same name is already used this is nicely logged in OpenSCD. But also the Complex Action is logged, saying that the Substation has been updated.
Reproduct:
- Open a SCD File in OpenSCD with at least 2 substations (or create a new one)
- Change the name of the first substation in the same name used for the second substation
- Updating fails, but a log entry saying the Substation is updated is also visible.
This needs to be discussed with @JakobVogelsang and/or @ca-d
@JakobVogelsang is still on vacation this week, and I'll not be available this Friday (public holiday in Germany), so maybe we should find a time slot to discuss this until Thursday.
I'd really like for this bug to be fixed, we always want the log to reflect what actually happened to the file. If it's not too urgent for you, I could contribute a fix next week on Friday at the latest.
@JakobVogelsang I'm afraid I lost sight of this bug, let's find a time to discuss this soon!