eclipse-basyx / basyx-aas-web-ui

Web-based user interface for managing and interacting with Asset Administration Shells (AAS)
MIT License
9 stars 7 forks source link

[BUG] Error when selecting an AAS that references a submodel not located in the Submodel Repository. #55

Closed JS-Aibel closed 3 weeks ago

JS-Aibel commented 1 month ago

Describe the bug An error occurs when selecting an AAS that references a submodel not located in the Submodel Repository.

To Reproduce Steps to reproduce the behavior:

In the AAS Environment do as follows.

  1. Upload an AAS with a Submodel.
  2. Delete the submodel from an API endpoint.
  3. Select the AAS in AAS UI
  4. An error occurs as shown below.
    Error while parsing the Submodel References!
    Error: Cannot read properties of undefined (reading '0')

Expected behavior According to the specification, the AssetAdministrationShell has a ‘soft’ reference to its Submodels, meaning it does not contain Submodels. Therefor, should the viewer account for missing submodels in the submodel Repository instead of triggering an error?

BaSyx (please complete the following information):

BaSyx configuration Default from the Quick Start Guide.

aaronzi commented 1 month ago

Hi @JS-Aibel,

Thanks for reporting this. What would be the behavior you would prefer when clicking on an AAS that references a submodel that isn't there? Just show a warning?

But you are absolutely right, an uncatched error that blocks the usage of the UI is not a good behaviour.

JS-Aibel commented 1 month ago

Thanks for the reply, @aaronzi.

It might be helpful with a warning that explains the different types of issues:

  1. Submodel Not in Registry: If the submodel isn’t in the registry.
  2. Submodel Fetching Issues: If the submodel is in the registry but can’t be fetched from the repository, either because it’s missing or there’s no access to the repository.

Pop-up warnings can be easily missed or forgotten. Therefore, it would be best if the warning is visible in the viewer whenever the AAS is selected. For example, the warning could be shown as a greyed-out submodel, displaying its ID and the reason for its absence.

aaronzi commented 1 month ago

That's a great idea. I will add this to our backlog. We will definitely implement this!

aaronzi commented 3 weeks ago

Fixed in #73