Clobbered project file

Has anyone else ever had it happen that a project you’ve been working on suddenly disappears your most recent work on it?

In my case I have a desktop project with a single window and a bunch of tabs. The most recently implemented tab I just had controls on, almost no code yet. That has vanished. The next most recently implemented tab has all its controls but 100% of the methods have been deleted from those controls.

As far as I can tell all this happened when I opened the project – developed so far in 2022r2 – using 2022r3.2. Project was saved in text format. I’ve been running this in 3.2 since, in debug mode only.

God only knows what else is gone. I’ve been extensively testing a different part of the app for the past couple of weeks in my spare time and have not looked through all the code.

Silly me, the last back up is even older. I thought I had more than that and hopefully my cloud backups will bail me out here … but anyway … who has had anything like this happen and are there any tips / tricks to share? I can’t seem to view the project as plain text to see if the code is lurking in there somewhere but just is not properly hooked up for some reason.

This represents the loss of at least a day’s work, probably more, and it’s not exactly a confidence builder in product stability.

ETA: I’m also curious about how macOS reports file sizes of projects. An older save in binary format is 1.3M, but the text mode project files are 2K with 12 byte resource files. There’s a lot more than 2K of info in them though. Opening them with TextEdit gives me that 2K apparently, just plain text info about the project in general. Opening it in Xojo I get everything but the missing parts.

I’m on Monterey, haven’t upgraded to Ventura yet. Mac Pro M1 with 32G RAM.

  1. A sub versioning system is a must for even basic developers. I prefer SVN, some people prefer GIT.

  2. Further I use zpaq64 to create hourly archives of my projects folder. It only creates an updated archive if data has changed.

Yeah I will definitely do that going forward. As for version control, yeah I should probably figure out Git or something. I use Git or TFS for all my paying work but I’m the only person working on this so didn’t bother. Of course the irony is I’ll bet with all your precautions you’ve never had to use those backups, lol

I have not had to go to the zpaq backups yet as so far have been able to recover direct from the SVN any messed up files. (As long as you get used to committing your code, or adding it to build steps for automatic commits)
Also if you are storing in Text or XML, you can compare your code.

What kinds of “messed up file” situations have you been seeing? User error, product bugs, uncertain?

And that’s when it happens. I’ve been at it for 37 years and rcs followed by cvs and then the more modern SVN and GIT have saved my sanity so may times that I feel like a cat working his way through many, many more than 9 lives :rofl:

Mostly user error, but occasionally project bugs due to trying new versions etc.

For me, I mostly suffer from user error caused by overly zealous application of a new IDE release and loading my working files instead of test copies and muscle-memory typing CMD-S/CTRL-S after I’ve made a change.

1 Like

I have an older binary version of the project with the same stuff in it. I suppose I might have opened that accidentally and then since the IDE was set to save as text by default maybe that silently renamed it for me.

Maybe. Who knows.

Yup. I’m working on year 41 and should know better.

In my defense, I have the underlying DB backed up six ways to Sunday, because the work invested in that is irreplaceable. This fell through the cracks because I was in transition to a new laptop and the cloud backup was still running on the old one.

I am going to assume this is my brain fart for now.

1 Like

Nothing on Time Machine ?

Don’t use Time Machine as I’ve had it fail me in the past. I use BackBlaze and that has been rock solid for me (albeit slow if you’re resurrecting an entire machine). But as I said, I was transitioning between machines and the backups were happening on the old one and so everything was dependent on me copying backups to that machine. Now it’s dependent on scripting :wink: And shortly the backblaze seat will move to the new machine.

Could BackBlaze have locked your Project during a backup and you didn’t notice?

How about checking in your APFS Snapshots? There should be some on the drive.

1 Like

Nice thought, and thanks for that, but there’s only one snapshot since startup, way back on Sep 20. I’ll have to see about getting those taken more frequently I guess. Really don’t know much about APFS snapshots.

If you’re using recent enough macOS, then Time Machne does local snapshots every hour.

Yabut I believe they only hang around for 24 hours. I hadn’t done any development for about 2 weeks so didn’t notice what had happened right away. I was using the finished parts of the app to maintain the DB.

I don’t think local snapshots are any sort of substitute for proper backups, but they might save your bacon in certain situations.

I had pretty much the same experience a couple of months ago. While editing, my project just vanished. Not a trace. When Xojo disappeared, I got no error messages, nothing. Not realizing the horror, I thought I just lost a few lines of code. So I quit for the night. When I came back to it a day or more later that was when I saw the bad news.

2 Likes

I’ve experienced where I’ve lost some of the changes and additions I have made, I’m working on a large program. When running in debug you can save your changes while your program is shutting down and the black circle stop button is visible then closing Xojo, this is where I believe the problem lies. Trying to think what was causing the problem and what I was doing, it’s been when I am in a hurry, my wife calling me saying my dinner getting cold. I haven’t tried to duplicate it yet so this is just a theory.

1 Like

I have mostly recovered from this debacle and now have a system for making daily backups.

Something no one has addressed among the questions I asked here, and it is likely at least partly a macOS issue and not a Xojo issue … my project size (saved in text format) shows 95 bytes and the resources file shows 1 byte. Obviously the 10 or so forms and associated code in this app are much larger than this.

That 95 bytes project file becomes “2K” when I copy it to another machine on the network.

GetInfo shows 1,889 bytes for that 2K project file, AND for the original 95 byte file.

This is not terribly reassuring that everything is being properly saved.

I know that Finder by default doesn’t show folder sizes, and that this is for performance reasons. And I know how to set Finder | View | View Options | Calculate all sizes to fix that. I thought I read somewhere that this will also bring individual file sizes up to date but right now from what I can find it appears this only applies to showing folder sizes.

If I open the backup project file with TextEdit I just see some general project info starting with Type=Desktop and ending with WindowsRunAs=0.

Where the heck is the actual code and layout info? Am I not backing everything up?