| Summary: | Refuse to open Sirius session or models from a more recent version | ||
|---|---|---|---|
| Product: | [Modeling] Sirius | Reporter: | Pierre-Charles David <pierre-charles.david> |
| Component: | Core | Assignee: | Esteban DUGUEPEROUX <esteban.dugueperoux> |
| Status: | CLOSED FIXED | QA Contact: | Laurent Fasani <laurent.fasani> |
| Severity: | enhancement | ||
| Priority: | P1 | CC: | esteban.dugueperoux, julien.dupont, laurent.fasani, maxime.porhel |
| Version: | 2.0.0 | Keywords: | triaged |
| Target Milestone: | 4.1.0 | ||
| Hardware: | All | ||
| OS: | All | ||
| See Also: |
https://git.eclipse.org/r/64846 https://git.eclipse.org/r/64889 https://git.eclipse.org/r/65086 https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=69f8e50b6e9089a141883882c5e14312c0a40a81 https://git.eclipse.org/r/71575 https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=f6b6e2a9ba90f681639b027966545e7172ab7acd https://git.eclipse.org/r/76602 https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=d5807d87855665f2c21e093cce23c466e00ab1c8 |
||
| Whiteboard: | |||
|
Description
Pierre-Charles David
To cancel session opening about this use case, a RuntimeException can be thrown during session opening, a OperationCancelException or a CoreException typically. In default Sirius UI, there are several means to open a session : - through a Modeling Project - through a simple aird resource. - at Eclipse restart with an opened editor - through a marker in Problems view For 2 first cases, session opening is done through OpenRepresentationsFileJob job. For 2 last cases, it is done through SessionEditorInput. OpenRepresentationsFileJob being a Job, if a session opening has been cancelled, a IStatus.ERROR is returned to inform end-user about the issue through ErrorDialog from Platform UI. Note that ErrorDialog appears only if Progress dialog is not displayed. For SessionEditorInput, a SessionEditorInput.status is used by opened editor to inform end-user that content can't be accessed, see Bug 480773. If another UI is used to open the session using SessionManager, it is the responsibility of the caller to react to RuntimeException or specifically to OperationCancelException to give UI feedback. To customize the way session opening cancel is displayed to end-user for the 2 first cases, Platform UI provide facility, see https://wiki.eclipse.org/Platform_UI_Error_Handling . And to leave mean to end-user to react to this message, by for example trying to reopen session ignoring the model/Sirius releases mismatch, we need a mean to give an option to session opening to ignore this model/Sirius releases mismatch. Bug 456326 has for goal to provide options at session opening. There is also the case of resource reload, for example resource content has been replaced, outside Session, by content from a newer Sirius release. It is for that we manage migration in DescriptionResourceImpl.load()/AirDResourceImpl.load() in addition to their factories. (In reply to Esteban DUGUEPEROUX from comment #2) > There is also the case of resource reload, for example resource content has > been replaced, outside Session, by content from a newer Sirius release. > It is for that we manage migration in > DescriptionResourceImpl.load()/AirDResourceImpl.load() in addition to their > factories. The only situation I see where this could be occuring would be two separate Eclipse instances, running different Sirius version, which share the same physical aird files. Otherwise as long as we are inside a single Eclipse instance, with a single Sirius version installed, I don't see a scenario where this could happen (but maybe I'm wrong). If the only case where this could happen is indeed when sharing the same physical files *at the same time*, I think we can simply document this restriction and live with it. (In reply to Pierre-Charles David from comment #3) > (In reply to Esteban DUGUEPEROUX from comment #2) > > There is also the case of resource reload, for example resource content has > > been replaced, outside Session, by content from a newer Sirius release. > > It is for that we manage migration in > > DescriptionResourceImpl.load()/AirDResourceImpl.load() in addition to their > > factories. > > The only situation I see where this could be occuring would be two separate > Eclipse instances, running different Sirius version, which share the same > physical aird files. Otherwise as long as we are inside a single Eclipse > instance, with a single Sirius version installed, I don't see a scenario > where this could happen (but maybe I'm wrong). > > If the only case where this could happen is indeed when sharing the same > physical files *at the same time*, I think we can simply document this > restriction and live with it. There is also the case end-user simply copy paste an aird to replace one from opened session. Ok I will document this not supported cases. Note that a StatusHandler, see https://wiki.eclipse.org/Platform_UI_Error_Handling , cannot be used because a single one for the whole product can be used and overriding the default one is too impacting for others non Sirius users. Waiting the possibility to use a typical SiriusResourceVersionMismatchException.OPTION_IGNORE_VERSION_MISMATCH at session opening, a static variable would be used : SiriusResourceVersionMismatchException.ignoreVersionMismatch (In reply to Esteban DUGUEPEROUX from comment #4) > (In reply to Pierre-Charles David from comment #3) > > I don't see a scenario > > where this could happen (but maybe I'm wrong). > > > > If the only case where this could happen is indeed when sharing the same > > physical files *at the same time*, I think we can simply document this > > restriction and live with it. > > There is also the case end-user simply copy paste an aird to replace one > from opened session. > Ok I will document this not supported cases. I had not thought of that case, but you're right. If it is possible to handle it without too much additional cost/complexity, we should try to handle it. New Gerrit change created: https://git.eclipse.org/r/64846 New Gerrit change created: https://git.eclipse.org/r/64889 New Gerrit change created: https://git.eclipse.org/r/65086 Gerrit change https://git.eclipse.org/r/65086 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=69f8e50b6e9089a141883882c5e14312c0a40a81 New Gerrit change created: https://git.eclipse.org/r/71575 For testing purpose, consider the version mismatch for the following resource: - main aird - controlled aird - selected vsm scenarios to tests: - open project - restart eclipse with an editor in the memento - export representation from file - open vsm Moving to 4.1, as it's too late the week before RC1 for such a change. Even though I don't see any obvious bug in the currently proposed patch, given the nature of the change almost any bug or unforeseen situation could make Sirius 4.0 completely broken, with sessions that refuse to open in some cases. The probablity of this happening seems low, but the impact *if* it happened is too big to take the risk. We'll try to merge this as soon as the maintenance branch for 4.0.x is done, so that we'll have as much time as possible to test this before 4.1. For the validation note that the default user feedback when there is a representation mismatch does nothing. If there is a vsm or representation version mismatch, the session is automatically closed and an error is logged. Consider the case that allows loading the representation despite the version mismatch as tested with junit test ResourceVersionMismatchTest. Scenarios: * open a modeling project with representation version mismatch (just increment the aird version)-> you have a dialog box message and an error in log * open a modeling project with vsm version mismatch -> you have a dialog box message and an error in log * Launch eclipse with a VSP in the workspace containing a vsm with a more recent version. -> A warning should be logged indicating that this viewpoint has not be registered in the ViewpointRegistry Gerrit change https://git.eclipse.org/r/64846 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=f6b6e2a9ba90f681639b027966545e7172ab7acd New Gerrit change created: https://git.eclipse.org/r/76602 Gerrit change https://git.eclipse.org/r/76602 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=d5807d87855665f2c21e093cce23c466e00ab1c8 Gerrit change https://git.eclipse.org/r/76602 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=d5807d87855665f2c21e093cce23c466e00ab1c8 Available in Sirius 4.1.0, see https://wiki.eclipse.org/Sirius/4.1.0 for details. |