che icon indicating copy to clipboard operation
che copied to clipboard

Auto saving issue

Open cifren opened this issue 9 years ago • 22 comments

I created this issue simply to say, maybe the auto saving on IDE should be an option for 2 main reasons for me :

  • First reasons is on auto-compiler (like JS webpack and other) works on watch files, so anytime a file change, a build is launched, the IDE takes 2 sec before running it, the auto-compiler goes for 5sec..
  • Second reason, whenever you close a file, the IDE saves the file, meaning when you run git checkout, close the file (it didn't update it on IDE) so the file gets erased by the old version.

Reproduction Steps:

First reasons is on auto-compiler (like JS webpack and other) works on watch files

  1. File changes (2s)
  2. Auto-compiler (5s) => 5s is not that bad, but it could be worst, use JAVA
  3. File changes (you forgot something... a dash...)
  4. Auto-compiler (5s)

Second reason, closing a file

  1. Open a file (./index.js)
  2. Run git checkout
  3. Git status => nothing
  4. close the file
  5. git status => shows index.js

Expected behavior:

First reason, manual save runs the compiler. Second reason, the file should update on the IDE.

Observed behavior:

Second reason, the file tab doesn't update on the IDE and overwrite the system file.

Che version: Nightly (suppose 5.0.0-M8) OS and version: Win7 - Boot2Docker Docker version: 1.12.3
Che install: Docker container

  • Problem started happening recently, didn't happen in an older version of Che: Yes
  • Problem can be reliably reproduced, doesn't happen randomly: No

cifren avatar Dec 29 '16 13:12 cifren

@cifren your motivation is clear for the first issue.

And I failed to reproduce the 2nd one.

ghost avatar Dec 29 '16 13:12 ghost

Second reason, closing a file

1.Open a file (./index.js) => 2. edit the file, add a line 3.Run git checkout 4.Git status => nothing 5.close the file 6.git status => shows index.js

I added a step, did you edit the file just before the checkout?

cifren avatar Dec 29 '16 13:12 cifren

edit the file, add a line 3.Run git checkout 4.Git status => nothing

I can see my changes when I modified a file.

ghost avatar Dec 29 '16 13:12 ghost

Did you do you step 5 and 6 ? That is at that moment the issue happens.

Step 5 would be "close the file tab", File tab is the tab in the IDE interface.

Can you see changes from the git checkout on IDE file tab ? My file tabs are not updating on my version whenever the shell is making changes. So when I close the tab, the IDE sends the old file version.

cifren avatar Dec 29 '16 13:12 cifren

@cifren steps 4 and 6 show that I have a changed file.

My file tabs are not updating on my version whenever the shell is making changes.

So you make your changes outside the IDE?

When you do git checkout, do you expect the remote to bring some changes to a local repo?

ghost avatar Dec 29 '16 13:12 ghost

Right now, I am using only the Eclipse Che interface, IDE and shell. This version is much better than the previous one, so I am enjoying it. (Before I was using, eclipse_che + atom + mRemoteNg(putty))

I haven't been clear.

On my version: IDE to shell is working well => I change my files on IDE and it changes my files on the linux Shell to IDE tab is not working => I change files on the system via shell console in eclipse che, the IDE file tabs are not updating from it. It causes issues when I close the tab that saves the file.

cifren avatar Dec 29 '16 14:12 cifren

Hmmm... when updating a file in the terminal, you do not see a green popup in the IDE, saying that the file has been updated?

ghost avatar Dec 29 '16 14:12 ghost

No I don't see it, I edited a file with nano, but the IDE file tab didn't replicate the changes.

cifren avatar Dec 29 '16 14:12 cifren

@cifren I cannot reproduce on a Linux machine. Must be some sort of boot2docker issue.

Have you had a chance to create account with codenvy.io and give it a shot there?

ghost avatar Dec 29 '16 14:12 ghost

Just tried it on a Win10 laptop. Everything works as expected. Can you create a new workspace with one of our sample projects? I suspect it has smth to do with the project itself.

ghost avatar Dec 29 '16 15:12 ghost

I did some tests and I does work on codeenvy but not on my boot2docker

cifren avatar Dec 29 '16 15:12 cifren

@cifren can you give it a try with one of our sample projects?

ghost avatar Dec 29 '16 15:12 ghost

Sorry I have been a little short on explanation.

I did a test on my boot2docker with a new build workspace with the "Create new workspace from stack" based on:

"recipe": {
        "location": "eclipse/node",
        "type": "dockerimage"
      }

Is that what you 're asking ?

cifren avatar Dec 29 '16 15:12 cifren

Yes. So, with a new workspace and a sample project in it, you aren't still notified when a file is changed?

ghost avatar Dec 29 '16 15:12 ghost

No, it doesn't

cifren avatar Dec 29 '16 15:12 cifren

I will give it a try on Win 8 with boot2docker.

ghost avatar Dec 29 '16 15:12 ghost

I am on win7 sorry... Universities are poor...

cifren avatar Dec 29 '16 15:12 cifren

I do not have Win 7. Win 8 has virtualbox and docker-machine and it should be the same.

ghost avatar Dec 29 '16 15:12 ghost

Here's what I have on my Win 8 machine with docker-machine and VirtualBox:

https://www.youtube.com/watch?v=BtIWrpTkj2g

So, I cannot reproduce it on Linux, Windows 10 and Windows 8 as well.

When your workspace run and file watcher fails, can you go in the terminal (in the IDE) to /home/user/che/ws-agent/logs, grab catalina.out and share its content here? Thanks.

ghost avatar Jan 04 '17 05:01 ghost

The issue seems to have disappear... It is working now, the update works on both side, nothing changed on my side since the last time, the only thing that changed would have been the workspace that has been re-built.

For my new tests, I did the same than last time:

  • I installed nano on the workspace
  • Opened the file tab
  • Modified with nano
  • The file tab got updated and the box appeared...

I did the same with Git, it worked as well.

So good news, that's working great now ! But we don't know why.

Another thing, is the workspace suppose to reset everytime it gets stopped and started ?

cifren avatar Jan 04 '17 10:01 cifren