Auto save projects?

I just lost half an hour of work while eating lunch. I forgot to save manually, stepped away from my computer, and when I came back was informed that it had spontaneously restarted (as all of our Big Sur Macs have been wont to do from time to time).

Is there no Auto-save feature in Xojo? I can’t find anything.

If your pc does suddenly restart you want want another one… never had such experience.

There is no autosave but you can add a script when run (debug) or build to save @Anthony_G_Cyphers uses such alot if i remeber well

Crash recovery should kick in if you have run the project since the last save, it seems that it’s broken again in 2021r3, just tested and reported <https://xojo.com/issue/66851> :frowning:

See Xojo Secrets: Tips and Tricks to Save Development Time – Xojo Programming Blog the section called Auto-Save, but no, there is no time based auto-save :frowning:

If your pc does suddenly restart you want want another one… never had such experience.

We have three different relatively new macs running Big Sur (two in the office and my laptop at home), and 10 or 11 macs in the office running older MacOS versions, all the way back to 10.6.8. Only the Big Sur macs crash with regularity. And by regularity I mean at least once a week, sometimes several times a week. Hard crashes - OS freezes, and then about 30 seconds later it reboots. No discernible pattern, they just lock up. We’ve reported to Apple but of course, you don’t hear back because Apple is perfect, and their hardware would never crash.

This is not a solution. It’s a workaround that addresses some of the problem, but wouldn’t have worked in this case, because I was in the middle of something when I left the computer, with a lot of undone code. Normally I habitually hit save, but was distracted and didn’t. I hadn’t run the app in probably 20 minutes or more because it wasn’t in a state where it would run.

All of the (very expensive) professional video post production applications we use have this feature and it has saved us on many occasions. I don’t see why this shouldn’t be an option in Xojo.

2 Likes

I’m still on 2021r2.1 and was never prompted to to recover a project.

Doh, looks like it might have broken a while back again then, it was meant to be fixed in 2021r1 after being missing for almost a year and a half but I can’t recall checking the fix (I usually checks all my feedbacks after a release). I’ll run back some old editions now and check but that doesn’t really help you, sorry.

If you haven’t run it since, it might be in a temp folder somewhere but I wouldn’t know where to look on the mac, maybe someone else can jump in there to help before I check.

I’ve already rewritten all the stuff I lost, but it would be good to know where that’s stored.So it doesn’t save the working project, but saves a temp version of it somewhere?

Because I did a test where I saved the project:
image

Modified the project:
image

Ran the project without saving:
image

Doesn’t show that it saved the project file I’m working on, which is ultimately what I care about. I would imagine the build script mentioned above would work, but that’s something you need to manually set up for each project, and again, is a clunky workaround to something that almost all applications offer.

Time-based auto-save is pretty important. I know some people don’t like it, but they don’t have to use it. I’m kind of shocked it’s not an option.

Is the dot the dirty project indicator on a mac? Is so, no it won’t change that as it’s not a full save, just a backup in case of crash type save.

See Normans comment here, I’m just checking where it is, unless they don’t at the moment, which could be the bug, doh.

1 Like

In Windows, they are saved in:

C:\Users\Julian\AppData\Roaming\Xojo\Xojo\Xojo 2019r1\AutoSave Projects\

So on Mac I guess they will be in:

/Users/Julian/Library/Application Support/Xojo/Xojo/Xojo 2019r1/AutoSave Projects/

Change username and xojo version where appropriate, also check in other folders of similar versions as they tend to go into the major version and not the sub version folders, so 2019r1 even on 2019r1.1 (not sure if that is a bug or not).

Bleh, on windows and mac I just tested 2019r1.1 and it created the autosave in the expected folder, but 2021r2.1 didn’t, so it does look like its broken again.

I just went back and checked it with 2021r1 which was reportedly fixed Case 57884 and it doesn’t work there either.

So that’s over two years and month now that crash recovery hasn’t been working.

image

I’m guessing the “.plcrash” files are the files I’m looking for? haven’t generated one in some time…

This is from /users/perry/Library/Application Support/Xojo:

It’ll be a copy of the project in an AutoSave Projects subfolder in binary format, I think those are the crash reports of the IDE. If you install 2019r1.1, save a project, dirty it, run it, force quit the IDE then look in the 2019r1 folder which will show up on the list from the screenshot you can see what you’re looking for.

1 Like

you know the drill, create a feature request. And if you dont convice enought people to “vote” for it, be ignored some years. And even if it is implemented expect it half baked a few releases.

Ad even if fixed…

At some point you are so frustrated with this app having NO quality that you stop making FC or voting. You accept it is a product that felt from the ugly tree, someone put it on the top and fell again, that can crash at any moment so, you just get used to press CTRL+S every 30 seconds. But also as once in a while it corrupts the save file so you have version control or at least frecuent backups. :man_shrugging:t2:

When the IDE crashes due to an exception or failed assertion, an unsaved project will be saved. When you relaunch, a dialog appears asking if you want to recover unsaved changes. However, if your Mac crashed (rather than Xojo) there would be no time for Xojo or any other app to do anything.

Xojo does not have an auto-save project feature. It did a long time ago when your app was running inside the IDE namespace. If your app crashed, it would crash the IDE. For a long time now your apps have run outside of the IDE so that’s not an issue.

Personally, if we were to implement a feature like this, I would prefer it to work like Apple’s document model where even a new, unsaved document is saved when you quit, crash, etc., and when you relaunch the app, the document remains in its unsaved state. The definition to unsaved essentially is only that the user hasn’t actively chosen to save the file. That might be tricky for us to implement with text projects but it would be possible certainly with binary projects.

1 Like

Perhaps I’m missing something, but how hard could it possibly be to implement a preference that says “save the current project every X minutes”? It can already be done via an IDE script, why can’t that be on a simple timer or something?

I get the appeal of the way Apple is handling crashes now, but if that’s too complicated, a simple brute-force timed save is more than sufficient to prevent data loss due to a crash outside of Xojo’s control. It’s not perfect, but it’s better than not doing anything. And then when there’s time to do it the way Apple is doing it, that’s great, just remove the preference.

1 Like

Are you sure about this?

As I mentioned above, 2019r1.1 used to auto save a binary version of your project and it stopped working overnight on the release of 2019r2, this was confirmed as a bug and an attempted fix was made in 2021r1 so I assume this was a real feature in the editions we’re talking about?

I made a little video with audio for you showing the problem just in case it wasn’t clear in this thread.

I was giving you details as they were given to me by Greg. However, he says he sees the crash recovery system in action nearly every day in the work he’s doing fixing crashing bugs. I’ll talk to him tomorrow and see if we can figure out what’s different between what you’re doing and what he’s doing.

1 Like

Anything in the logs or shown on screen?

That’s rather unreliable. I’ve taken the habit to not rely on autosaving in Xojo; a shame, as I’m always worried to lose something, should I be too much concentred on my code or distracted instead of saving.
Like Perry, I can’t see why Xojo won’t save automatically every x minutes by default, as even small apps do that, and certainly all big apps do as well.

Yes, indeed.

That’s logical and not a single app would be expected to save anything in such situation. Automatically saving in the temporary folder is, IMO, crucial for any editing software.

It’s nice that time where the app was running in the IDE namespace is gone; I remember how unstable that was. But I fail to see how separating the IDE and the debug app means autosaving can’t exist, as you seem to imply.

Better than not saving at all.
I’ve still not managed to get accustomed to this “new” way of defining the unsaved state. Still liking the old way where I know I have to decide to keep a modified document when I close it, rather than accumulating unsaved things in apps all over the place; I tend to forgot that a closed app may still contain documents I’ve not saved and are currently invisible to me.

No - it’s always the same pattern: Screen locks, then about 30 seconds later it goes black for a few moments, then you get the multi-lingual “your mac crashed and has to be restarted” text. When it restarts, you get a warning upon login that the mac crashed, etc etc.

I am no expert at parsing system logs, but did find this:

perry$ log show --predicate 'eventMessage contains "Previous shutdown cause"' --last 24h
Filtering the log data using "composedMessage CONTAINS "Previous shutdown cause""
Skipping info and debug messages, pass --info and/or --debug to include.

Timestamp                       Thread     Type        Activity             PID    TTL  
2021-12-01 13:53:02.511296-0500 0xed       Default     0x0                  0      0    kernel: (AppleSMC) Previous shutdown cause: -20
--------------------------------------------------------------------------------------------------------------------
Log      - Default:          1, Info:                0, Debug:             0, Error:          0, Fault:          0
Activity - Create:           0, Transition:          0, Actions:           0
P

According to that web site, the -20 error means:

BridgeOS T2-initiated shutdown. The T2 chip in your 2018+ MacBook Pro or other Mac (list in link) initiated a shutdown.

There was a time when Xojo wrote a crash recovery version of your project when you ran it in the IDE. I’ve just tested this by force quitting Xojo 2014r2 after running a new project. When I relaunched Xojo it asked if I wanted to re-open the project.

If you do add some kind of auto save please make it configurable. I personally would not want the IDE to replace my project files without me explicitly telling it to.

1 Like