Bug 429782 - Memento is not restored using session's main resource URI
Summary: Memento is not restored using session's main resource URI
Status: CLOSED FIXED
Alias: None
Product: Sirius
Classification: Modeling
Component: Core (show other bugs)
Version: 1.0.0M7   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.0.0   Edit
Assignee: Project inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2014-03-06 10:10 EST by Alex Lagarde CLA
Modified: 2015-05-20 07:54 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.