Not able to generate a merge conflict in Theia v0.11.0

Hi,

We have a VS Code extension that does basic file operations and trying to maintain consistency with a remove server.
The way we do it is we download the needed file locally, user can edit, and upon save (CTRL+S) we try to upload the file back to the remote server using ETag to check for file consistency. If the Etag doesn’t match:

  • we store the content of the local file (from the active editor pane)

  • we download the new version of the file (with new Etag)

  • we write back the old content in the active editor, then call save() on the opened document.
    In VS Code, this triggers the merge conflict, because the content of the file is newer on the filesystem, but I am not able to replicate this behavior in Theia (using v0.11.0).

The behavior that I notice is that in Theia, whenever I write back the old content in the active editor, I don’t get a dirty file that I am able to save, but it seems that the content is written directly on the filesystem, thus skipping the merge conflict situation that I want to create.

Any hints on what I might be overlooking?

Thanks,
Alex

[original thread by Alex Dumitru]

Hi @alex-dumitru . It’s possible that the issue is one related to file watchers. Can you try to open a random file in your Theia application and modify and save the file from outside Theia, for example using VIM. If everything works as it should, you’ll get a pop-up dialog telling you that the content on disk changed, and asking which version you want to keep.

Sounds like a bug, could you open the issue please and if you can share your extension.

[Alex Dumitru]

@marc-dumais @anton-kosyakov
Thanks for your replies.
@marc-dumais I couldn’t generate the Compare so I went ahead and opened a git issue for this: https://github.com/eclipse-theia/theia/issues/7036
I hope I provided enough details to go forward.

@alex-dumitru Ah, you’re on Windows. Do you run your Theia app natively or on/through the Windows Subsystem for Linux ?

And do you run VS Code the same?

[Alex Dumitru]

I am running them both natively, and I tested against Theia @next out of docker as well

Related issue: https://github.com/eclipse-theia/theia/issues/7102