Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 429782

Summary: Memento is not restored using session's main resource URI
Product: [Modeling] Sirius Reporter: Alex Lagarde <alex.lagarde>
Component: CoreAssignee: Project inbox <sirius.core-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: maxime.porhel, pierre-charles.david
Version: 1.0.0M7Keywords: triaged
Target Milestone: 1.0.0   
Hardware: All   
OS: All   
Whiteboard:

Description Alex Lagarde CLA 2014-03-06 10:10:05 EST
There is an issue in the way the SessionEditorInput opens the session when it's restore form the Navigation History: it uses the URI of the representation instead of the main session resource (aird) URI.

Steps to reprocuce (with a breakpoint on SessionmanagerImpl.createSession(URI))
- Create a modeling project
- Create an ecore semantic resource
- Create a representation ("REP1") on the root package and through this representation a sub-package
- Create a representation ("REP2") on the sub-package
- Control the sub-package and this new representation
- Close and reopen the Modeling Project
- Open the 2 representations, close "REP2" and click on the "Back to REP2" left arrow in the tabbar
=> KO : instead of using the already openened session, a new session on the aird fragment is opened

Notice that the bug does not occur when restarting eclipse, but only in the context of the Navigation History.
Comment 1 Maxime Porhel CLA 2014-03-07 08:31:48 EST
The issue is more visible if you do not create a Modeling Project but a standard project: when you use the "Back to REP2" arrow, a second session appear under the sub-aird.

Alex indicated the left arrow in the tabbar, he wanted to reference the main toolbar.
Comment 2 Maxime Porhel CLA 2014-03-07 08:51:56 EST
SessionEditorInput.dispose() is not called from Tabel and Tree editor, so the session is kept in memory, through its editorInput, by  org.eclipse.ui.INavigationHistory and org.eclipse.ui.internal.EditorHistory.

We could use the (main) session resource URI only, and retrieve it from the session manager on getSession() calls. SessionManagerImpl could have a map sessionResourceURI -> Session to retrieve faster the known sessions.
Comment 3 Alex Lagarde CLA 2014-04-15 11:12:17 EDT
Git review accepted and merged (https://git.eclipse.org/r/#/c/23193/)
Comment 4 Pierre-Charles David CLA 2015-05-20 07:54:39 EDT
Available in Sirius 1.0.0.