Repository navigation
GLSP-1827: Fix own save triggering the source model changed dialog - #306
Merged
Merged
Conversation
The WatchService delivers events asynchronously, so the event of a save can arrive after the watcher resumed and pass the paused check. - Record the file's modification time and size on resume and drop events while the file still matches. A resume delay would depend on the platform's event latency and miss every external edit within it - Add a test that pauses, writes and resumes without waiting, the way SaveModelActionHandler does Fixes eclipse-glsp/glsp#1827
tortmayr
force-pushed
the
fix-file-watcher-own-save
branch
from
November 17, 2026 14:21
2d11d48 to
6d98379
Compare
- Rename hasChanged() to updateKnownState(), since it also records the state and a second call for the same event returns false - Document that the comparison depends on the file system's timestamp resolution
fismif
approved these changes
Nov 17, 2026
fismif
left a comment
There was a problem hiding this comment.
LGTM, thanks! I verified the bug fix myself and also the waytcher tests pass reliably.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What it does
The
WatchServicedelivers events asynchronously, so the event of a save can arrive afterSaveModelActionHandlerresumed theFileWatcherand pass the paused check. The client then shows the "Source of editor changed" dialog for the server's own write.WatchServicepolls every 10 s by default) and miss every external edit within itSaveModelActionHandlerdoesFixes eclipse-glsp/glsp#1827
How to test
FileWatcherTestcase fails without the fix (1 notification instead of 0) and passes with it, verified locallym2+fatjarandp2builds pass, checkstyle cleanManual: open a
.wfdiagram in the Theia integration, edit and save repeatedly. The "Source of editor changed" dialog no longer appears. Editing the file in a text editor still shows it.:java -jar examples/org.eclipse.glsp.example.workflow/target/org.eclipse.glsp.example.workflow-2.9.0-SNAPSHOT-glsp.jar -p 5007pnpm run browser start:debugFollow-ups
Changelog