STARIONGROUP / COMET-IME-Community-Edition

The Concurrent Design Desktop Application and Excel Integration compliant with ECSS-E-TM-10-25 Annex A and Annex C
https://www.stariongroup.eu
Other
22 stars 5 forks source link

IME open model in iteration selection dialog - opening model as non-active domain should not be allowed #611

Open MartinFijneman opened 3 years ago

MartinFijneman commented 3 years ago

Prerequisites

Description

In specific testing situation it was possible to open a model representing a domain of expertise that was not an active domain. This happened in specific case given below in steps to reproduce, and using the direct opening of a model: double-clicking the model or click "Open" in the Iteration Selection dialog. This should not be allowed (as this may lead to confusion or subsequent problems related to ownership).

If the default domain is not an active domain in the engineering model, the user should be switched to the other selection dialog to choose a required domain.

Steps to Reproduce

this can then lead to problems:

Logs

System Configuration

lxatstariongroup commented 3 years ago

I have doubts on the correctness of the code in line 297 of the ExecuteSelectActiveIteration method in ModelOpeningDialogViewModel:

var defaultDomain = session.ActivePerson.DefaultDomain ?? activeIterationSetupRow.DomainOfExpertises.FirstOrDefault();

The defaultDomain variable is later used to read data from a session (session.Read(iteration, defaultDomain)). I think that the session.ActivePerson.DefaultDomain could be missing in a specific EngineeringModel, so this could be a wrong DomainOfExpertise for that EngineeringModel.

@samatrhea @MartinFijneman could this be the behaviour Martin experienced last week?