Bug 478080 - Make the "auto-save when no editor is opened " feature more robust
Summary: Make the "auto-save when no editor is opened " feature more robust
Status: ASSIGNED
Alias: None
Product: Sirius
Classification: Modeling
Component: Core (show other bugs)
Version: 3.0.0   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: Next   Edit
Assignee: Project inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2015-09-22 11:36 EDT by Cedric Brun CLA
Modified: 2018-09-03 08:57 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cedric Brun CLA 2015-09-22 11:36:23 EDT
Right now in Sirius the session is being automatically saved no editor is opened but the model has been changed.
This feature is implemented through SaveSessionWhenNoDialectEditorsListener which is notified of the model changes as a ResourceSyncClient.

The ResourceSyncClient API is quite low in the stack and provide notifications as they happen which might be :
- *while* a change from a command is being made
- *while* a change from the workspace is being captured and processed 

There are pretty much no guarantees regarding the current session state when these notifications are happening : we might be in the middle of a command execution or in the middle of a a workspace delta processing (which is expected as this API doesn't even know the concept of a "Session")

This lead to the fact that SaveSessionWhenNoDialectEditorsListener might trigger a Session.save() *while* we are processing deltas and potentialy will reload the resources : in the end a brittle situation which might be reflected by some of the automated tests we consider "unreliable" : the orchestration  depend a lot on the workspace delta events timing.

A proposed solution to this is to transform the SaveSessionWhenNoDialectEditorsListener into a post-commit listener, in doing so :
- it gets triggered when the Session has finished processing all its events from the workspace
- it doesn't have to analyze individual resource change events to detect if the project is being renamed/moved/deleted
- it can directly ask for the session status (SYNC or DIRTY) and decide upon that.
Comment 1 Eclipse Genie CLA 2015-09-23 04:42:49 EDT
New Gerrit change created: https://git.eclipse.org/r/56501
Comment 2 Pierre-Charles David CLA 2015-12-15 04:11:23 EST
Moving out of the 4.0 scope for now, along with all the other issues which were there "by default". This does not mean some of these will not be re-integrated at some point, but for now these issues are not part of the roadmap for 4.0.

If you feel strongly about this removal from 4.0 and/or are ready to sponsor the corresponding work, feel free to comment.
Comment 3 Pierre-Charles David CLA 2016-09-07 09:44:14 EDT
The impacts are deep enough that we don't want to merge this late in a cycle. We'll try to merge it soon in the 5.0 cycle.
Comment 4 Pierre-Charles David CLA 2017-04-10 08:11:14 EDT
After discussion with Cédric, the current patches are not stable enough. The whole subject will probably need significant effort to fully understand the expected behavior, including corner cases client code may depend on before making changes. I'm putting this in 5.1 for now, but it's not clear we'll be able to make such a change in that timeframe, especially since it may involve API breaks.