| Summary: | Resource reload on external changes invoke an EEF refresh in a wrong context | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Modeling] Sirius | Reporter: | Pierre-Charles David <pierre-charles.david> | ||||
| Component: | Properties | Assignee: | Pierre-Charles David <pierre-charles.david> | ||||
| Status: | CLOSED FIXED | QA Contact: | Julien Dupont <julien.dupont> | ||||
| Severity: | major | ||||||
| Priority: | P3 | CC: | julien.dupont, steve.monnier | ||||
| Version: | 4.0.0 | Keywords: | triaged | ||||
| Target Milestone: | 4.1.0 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| See Also: |
https://git.eclipse.org/r/81984 https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=1d4983b3a0bc0a3f0fb6c4e9ffdee938ec2385d1 |
||||||
| Whiteboard: | needtest | ||||||
| Attachments: |
|
||||||
Created attachment 264443 [details]
Video illustrating the bug
This is using:
- Sirius v4.0.0-262-g30f2c09
- EEF v1.7.0_M2-14-g4e21ca9
New Gerrit change created: https://git.eclipse.org/r/81984 Gerrit change https://git.eclipse.org/r/81984 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=1d4983b3a0bc0a3f0fb6c4e9ffdee938ec2385d1 Fixed. Available in Sirius 4.1.0, see https://wiki.eclipse.org/Sirius/4.1.0 for details. |
Steps to reproduce: 1. Open a Sirius diagram on a semantic model M, with the properties view enabled. 2. Open the semantic model in a separate (non-Sirius) EMF tree editor. 3. In the (non-EEF-based) property view of the EMF editor, change the semantic model. Save. An error occurs, with a message similar to this: An issue has occurred during the evaluation of 'aql:self.executeOperation('platform:/plugin/org.eclipse.sirius.ui.properties/model/properties.odesign#//@groups.0/@controls.0/@ifs.0/@widget/@initialOperation')'. executeOperation(org.eclipse.emf.ecore.EObject,java.lang.String) with arguments [org.eclipse.emf.ecore.impl.EPackageImpl@20dcc146 (eProxyURI: platform:/resource/extlibrary/extlibrary.ecore#/), platform:/plugin/org.eclipse.sirius.ui.properties/model/properties.odesign#//@groups.0/@controls.0/@ifs.0/@widget/@initialOperation] failed: null On first analysis, what happens is: 1. Sirius detects the semantic model changing in the workspace. 2. It reloads the new version of the resource in the session. 3. The new version of the resource triggers a refresh, which changes the diagram's model. This is done in a transaction, so after the refresh is done, EMF Tx launches the registered post-commit listeners. 4. One of these is org.eclipse.sirius.ui.properties.internal.TransactionalEditingDomainContextAdapter.Listener, which is in charge of refreshing the EEF-based properties view when the model changes from inside Sirius. It ends up invoking org.eclipse.eef.ide.ui.internal.Updater.apply(List<Notification>), which calls org.eclipse.eef.properties.ui.api.EEFTabbedPropertySheetPage.refreshPage(). 5. Because the EEF view is not actually visible, it still holds on to the old pre-reload version of the variables (e.f. "self"), so when it calls STS.executeOperation(), it is on a target element which is now a proxy. This is not a case which was envisioned and it crashes.