menu
announcement

Spectrum is now read-only. Learn more about the decision in our official announcement.

Theia

Eclipse Theia - Cloud & Desktop IDE

Channels
Team

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

January 30, 2020 at 2:46pm

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

January 30, 2020 at 2:46pm (Edited 3 years ago)
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

January 30, 2020 at 8:28pm
Hi . 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.
Edited

January 31, 2020 at 3:06am
Sounds like a bug, could you open the issue please and if you can share your extension.

January 31, 2020 at 12:00pm
Thanks for your replies. 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.
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?
I am running them both natively, and I tested against Theia out of docker as well

February 12, 2020 at 2:29pm