Working Copy How To?

@dave1707 that actually doesn’t guarantee that data persists either. I just ran a project that way and still lost data.

@UberGoober The save should save the code, what data are you talking about.

@skar I don’t think it documented anywhere, if it is I don’t know about it. I think it’s just in the Codea version release info which is in a discussion “Codea Roadmap”near the top of the forum. It hasn’t been updated for awhile.

@dave1707 In running the tests for my project, I create, write to, read from, load, and delete tabs.

I don’t know if that affects anything, but it,might, so I mention it.

The way the bad thing happens is: I edit code, I run the project, I go back to the editor, my edits are gone.

This has happened even with the “save & run” feature you mentioned, I’m sorry to say.

And it happens both on tabs I’m writing to and tabs I’m not.

Before I run my projects these days I close out of them and open them again.

Even that does not 100% prevent this from happening, but it seems to make it less likely.

It’s almost guaranteed to happen if Codea crashes while the project is running.

It has happened without crashes too, though.

I was slightly excited to learn about “save & run,” because quitting out of a project every time I want to run it is a pain.

But as I said, it doesn’t prevent the bug either.

@UberGoober I just found a bug when writing to a tab. I reported it to Simeon, so we’ll see what happens. The problem was in the newest Codea version I just downloaded and I also tried it on an older version and the problem happened there too. So maybe there will be a fix soon.

@dave1707 nice snooping!

I’m not writing to project data because my goal is to create a tab that gives users code they can copy and paste into their own projects.

@dave1707 @UberGoober it would be good to know if you still experience any data loss issues with beta build 266

@Simeon (version 266) Same problem I reported earlier about using saveProjectTab. Code disappears when a tab is created. Also using saveProjectTab, if I do the long press and select save &run, the code is saved but the new tab doesn’t show until I exit the code and go back in.

I’m using “working copy” now and I don’t know if this has anything to do with that, but yesterday I saw an edit revert right in front of my eyes.

I understand if it’s hard to believe, I could barely believe it myself.

I think it happened while the keyboard was either appearing or being dismissed.

Also, and I don’t know how it might be related, but the editing cursor is constantly jumping to the top of the tab I’m on.

I am using working copy in split-screen with Codea, maybe that’s having an effect? I’ll stop doing that and see if it changes things.

The editor-scrolling-to-top bug seems to be gone in 266

@Simeon - noted, on a couple of occasions that Codea crashed on me when I was editing. Haven’t posted yet as can’t seem to duplicate. Seems to be just after placing cursor and deleting character to left.

266: I just lost a bunch of data on a tab that I write to during the app’s running time.

I had updated the values and saved over them a bunch of times.

Then I closed Codea, and a while later I came back to the app and everything I’d done was gone.

This is exactly what happened in the last version, and the reason why I went and got Working Copy. Luckily I’d committed everything I did before the data was lost, so I was able to pull it all back from the git.

i’m rather sure that Working Copy won’t revert unless you ask it to. I have found that Codea often seems not to pick up on a revert, and I always exit the project before I do a revert. I’ve not seen that fail.

I do not often write to tabs, so have no info on that.