This has happened to me twice in the past week (in two different forms), and I am looking for a sanity check:
While working in a form, I change something like a form variable or modify an associated list value. After completing the modification, the variables and methods for that form suddenly disappear. When I examine the form’s corresponding JavaScript file in the workspace, the file is empty (file size is 0KB). Anyone else see this?
I haven’t seen this other then when you really alter the logic flow of the JS file (adding or forgetting curly brackets) but that usually just drops 1 method or so or simply refuses to save the file because it’s not validating.
Can you try to reproduce this by modifying something and save the whole source in a text editor before you hit save?
I have seen what you described as well and had to occasionally re-add deleted methods (I thought it was something I did that caused the deletion). Ill-formed methods should be flagged with a warning/problem marker and not deleted (I do not believe Servoy is intentionally deleting things). I suspect that whatever process is deleting the methods, under certain conditons, goes beserk and deletes the entire contents of the Javascript file.
The first time this happened, I was unaware that the contents of the Javascript file had been deleted, and was made aware when running the solution (Developer reported that it could not find a particular method). I was stunned to find that the Javascript file contents were empty. I was able to restore the file from a recent back-up. A few days later, the same thing happened, but in a different form and file and, again, I was able to restore the file.
Once the files were restored, I was able to edit/save the methods/variables with no further problem. These seemingly random events caught me off-guard, so I do not have much information to give. However, now that I know someone else has noticed, I will try to more closely notice what is happening.
If anyone else has come across these issues, would you kindly add to this post.
Can you check the log files from when this happened?
Check /path/to/servoy/application_server/servoy_log.txt and /path/to/servoy_workspace/.metadata/.log
It sounds like some internal error that causes this.
kwpsd:
I was stunned to find that the Javascript file contents were empty. I was able to restore the file from a recent back-up. A few days later, the same thing happened, but in a different form and file and, again, I was able to restore the file.
Eclipse saves all file changes into local history. You can open up a compare editor with any version in local history (or on SVN for that matter) and restore the current editor that way as opposed to going to an backup. In the context menu of any editor.
Thanks for taking a look at the log files. The computer on which the problem occured has over 300 GB of free space, so I don’t think it’s a full disk issue.