open-scd icon indicating copy to clipboard operation
open-scd copied to clipboard

Subscribing on minimal ExtRef definition

Open JakobVogelsang opened this issue 1 year ago • 2 comments

As a user of OpenSCD I want to be able to see already existing subscriptions in OpenSCD in all circumstances. At the moment when an ExtRef element has missing srcLNClass and srcLNInst is interpreted as unsubscribe. That however is incorrect as described here.

grafik

Acceptance Criteria On checking existing subscriptions, the existing rules must be extended so that:

  • have srcLNClass defaulting to LLN0 when missing
  • have srcLNInst defaulting to empty string when missing

Example <ExtRef iedName="AA1E1Q01BCU" ldInst="MV" ... srcLDInst="LD0" srcCBName="gcb" serviceType="GOOSE" /> must be interpreted as <ExtRef iedName="AA1E1Q01BCU" ldInst="MV" ... srcLDInst="LD0" srcLNClass="LLN0" srcLNInst="" srcCBName="gcb" serviceType="GOOSE" />

JakobVogelsang avatar May 22 '24 08:05 JakobVogelsang

What plug-ins are affected in this issue?

Sander3003 avatar May 24 '24 09:05 Sander3003

On which plug-ins does this occur?

  • Later binding / message binding
  • Goose / SMV

pascalwilbrink avatar May 24 '24 09:05 pascalwilbrink

It could appear in all the six subscriber plugins:

  • Later binding (GOOSE)
  • Later binding (SMV)
  • Message binding (GOOSE)
  • Message binding (SMV)
  • Data binding (GOOSE)
  • Data binding (SMV)

JakobVogelsang avatar Jul 02 '24 07:07 JakobVogelsang

The problem is likely to be found here:

grafik

Here, a query is constructed with the assumption that srcLNClass and srcLNInst are not empty.

JakobVogelsang avatar Jul 02 '24 07:07 JakobVogelsang

After having looked into the issue for GOOSE later binding the code that fetches the list for the subscribed list is here

https://github.com/openscd/open-scd/blob/main/packages/plugins/src/editors/subscription/later-binding/foundation.ts#L258-L271

and does not call packages/plugins/src/editors/subscription/foundation#getExtRef at all.

The filter for srcLNClass and srcLNInst is here

https://github.com/openscd/open-scd/blob/main/packages/plugins/src/editors/subscription/later-binding/foundation.ts#L164-L188

It looks like the check for srcLNClass fails, because a missing value is transformed to empty string and compared to lnElement.lnClass which is probably 'LLN0'. The srcLNInst passes, because a missing value is interpreted as empty string which is the default value by coincidence.

Take note that the comparison function converts missing element, missing attribute and missing value to empty string.

https://github.com/openscd/open-scd/blob/main/packages/plugins/src/editors/subscription/later-binding/foundation.ts#L126-L144

clepski avatar Jul 04 '24 13:07 clepski

The part in packages/plugins/src/editors/subscription/foundation#getExtRef is being used in the Message binding plugins

clepski avatar Jul 04 '24 14:07 clepski

@clepski this would be the file for the regression test. It has SMV and GOOSE services linked to the ExtRef and both would fail to show correct subscription at the moment.

dafaultSrcLNClassSrcLNInst.scd.zip

JakobVogelsang avatar Jul 09 '24 08:07 JakobVogelsang

@DavoodSooran can you validate this story?

Sander3003 avatar Jul 12 '24 14:07 Sander3003

I suggest to close this issue and create an new issue and pull-request for the following finding: https://github.com/openscd/open-scd/issues/1556

Sander3003 avatar Jul 16 '24 09:07 Sander3003