GIT and XOJO 2020R1.1 Project folders issues

Greetings,

Is seems that there is an issue with the Folders that you create in the xojo_project type and it seems that today I just discovered that code is lost after committing so what would be the best way to avoid this as it is messy and not safe so far.

As example , I created a project , safe it as xojo_project.

added a folder called UIControls, I added there a window with all the code and all the details.

pushed the changes on git and committed and when I reopened the project just now, all what was in UIControls is missing, and I get errors that it could not find the window I just created and that that part is lost.

Now, how I can recover that and why xojo is changing the folder structure and deleting code ?

MacOS Mojave and XOJO 2020R1

Thanks.

Just created a bug report as well 61802, hope somebody has a logical explanation for this, as loosing time and code is not our main goal here

I haven’t experienced this, and we use folders extensively.

Was the file that represents the window in your commit? Is it still in your folders on disk? Did you also commit the main project file?

Hello Kem, Apparently it seems that the file disappeared along with the folder once I saved the project and closed XOJO, so no more UIControls folder on the Disk, I do have the UIControls on the project but it has the previous added controls there and the latest window it simply disappeared, so I assume it is something wrong on XOJO side and not on git side. and this was a newly created project so not an old one. That is weird for me as well as using XOJO 2019R3.2 does not do that kind of issue.

Now creating it again and saving the project again, asking me to override the old one it saved the file on the disk, it Created the Folder UIControls as well so it is super weird. But still I have to canvases as custom buttons in UIControls in the Project Folder in IDE but in the disk they are under Code folder so something is changing on the xojo side. and apparently the change is random.

macOS ?

If so, did you activate iCloud ?

iCloud Drive is Active but Desktop & Documents folders is unchecked so it should not affect Documents Folder.

It seems to be a good suspect.

Read the Topic dedicated to iCloud misbehavior in this forum.

Never seen this, also not with 2020r1.
What I did sometimes was to update an external project file which was not included in the package and later reset by another project sharing it incidentally, or to forget to consolidate links lying somewhere else on my disk, or even use the wrong feature in the Git GUI I was using at that time.

What Xojo does anyway is to do some unnecessary code beautify in items I cannot even remember touching, or to add or move some internal properties. So I usually check every code snippet to include in the commit. Where I also failed at times.

1 Like

Something to keep in mind… the layout of your project isn’t only based on the layout in Finder. The project also keeps an internal manifest in memory. What I’m trying to say is “don’t move things around on disk in text projects. Let the IDE do that for you.”

The way I handle support files(things like icons and support docs that don’t actually live in the project) is to put them in folders whose name starts with an underscore. The reason for this is two-fold:

  1. They’re all kept together in the directory listing on disk.
  2. Since the IDE won’t let you create items with underscores as the first character, you’ll be hard pressed to accidentally overwrite those files on disk.

Well that was my point as well and I never touch a project in it’s Folder in finder, always from the IDE only, the thing here is I notice it long time as well, for example if you add a folder in the IDE and then you add something on it , then let’s say you double click on that folder in the IDE, it seems that everything disappears from it and if you go back it appears but from experience there the issue starts. Or if you have a folder but noting in it and you save the project, it will delete that folder. Now based on the tests after closing the project and opening it again it will work ok for a while but it always creates issues in the first time the project is created. I’ll dig more and if I can replicate this I will make a movie and update the feedback . I remember we had this issue before, I report it and it was fixed but it seems that it came back again.

Just out of curiosity, are you using any special characters in your folder names which might cause issues if you used them in Finder, like / or : ?

1 Like

nothing at all ,and it seems that this is random, and I cannot replicate it. so I’ll have to be able to have the time to play with it , try to replicate it , and once I can, then make a test project and a movie eventually and create another bug or reopen the current bug report.

And it seems that the folder Code is created only if you have classes copied from another project and most probably they are set maybe as external or so, as this happens only when I copy / paste classes from another project and then I do gather project files . maybe it helps .

You’re using the IDE command for this? If so, Do you save immediately after this command?

all manual from the menu , and usually yes, save immediately after and close the project to sync it on git .