It looks like you're new here. If you want to get involved, click one of these buttons!
Hello all,
1)With Codea 3.0, and with my project file stored in the Working Copy directory, I am experiencing issues where I will run the project, then return back to the code, then maybe try to run it again and return to code, and it seems to have lost recent changes that I had made. This isn’t a proper bug report, as I haven’t yet put a finger on exactly how to reproduce it. I just know I’ve lost some code this way a handful of times today, and I’m wondering if this is a known issue. I will try to pin down a sequence to reproduce the issue.
With the previous version, I never had an issue like this. Code I wrote was code that stayed.
2) The editor isn’t consistently ‘behaving’ properly - for example, I’ll tap return after entering function foo()
and Codea doesn’t always auto add the end
keyword. It also is not always auto-indenting lines within a code block.
Comments
@brianolive What level of 3.0 code are you running. I mentioned the missing end keyword and left justification problem in the Codea version 184 discussion. As far as I know it was fixed and I haven’t seen it since. As for the missing code, I think I remember that happening but I’m not sure what version that was in and if that was also fixed. I’m not sure if it has happened recently. I’m currently running Codea 3.0.1 version 187.
Version showing as 3.0 (187).
Project being in working copy doesn’t seem to have anything to do with it. It just happened with a project stored in the Codea folder.
I’m not doing a good job tonight of tracking what leads up to the problem! Each time it happens, I don’t clearly recall what I did right before it happens...to be continued...
I wonder if this is tied in with the disappearing keyboard. Recently found the keyboard not being launched after tapping an input or the screen in the editor. Seemed to happen when I had left the editor for a while. Closing project and re-opening needed to resume normal editing.
@brianolive are you using the feature where you can drag-and-drop sprites or shaders into code? Because there appears to be a bug with that where changes are lost
@Simeon No, I am not using that feature (but sweet feature, btw!). I'm sorry to make you have to guess what I'm doing. I'll figure out exactly what I'm doing that causes this to happen - hopefully later this evening.
I’m losing code also, just by tapping code, run it, and Codea crash.
When I reopen the project, it has returned to it’s preview save. My solution is to close and reopen the project before each run. -_-
Could you all post your iOS and Codea versions when you post (like @dave1707), it helps narrow down the problems and helps @Simeon et al focus on the right code. Or, you could fill those details in your profile and update when necessary.
I'm on iOS 13.1 and Codea 3.0.1 (187).
@Simeon , what is happening to @moechofe2 is what I am experiencing. I thought it happened in another case too, but at least once I definitely had the same sequence of events he had. 3.0 (187)
@brianolive @moechofe2
So the process is
1. Run code
2. Codea crashes (code doesn't run)
3. Re-open Codea and notice that last edits are not saved in the file
But I'm guessing (2) doesn't happen consistently?
There is a hidden feature that might help you work around this while I debug the issue:
Long press play - nice! Great to know.
Step 2 is not a problem on your end - it is not consistent. That (usually) only happens when something is wrong with my code that makes Codea/Lua unhappy...
The loss of state after that crash is the issue.
I have also seen this code loss happen though without an app crash. I’ll return to the code editor, maybe make some code changes, run my code again, and then notice that the program is still executing from the previous version of my code (i.e. how the code was before my most recent edits). I’ll think to myself (for example), “How can that be? I just commented those lines out”, or something like that...then return to the editor, only to see that the changes I made (commenting out lines, adding new lines, etc.) are gone. Codea was running the code from a state before my last changes.
IOS 12.4.1
Codea 3.0 (187)
I’m using iCloud as document storage from the setting app.
@Simeon the steps are exactly as you describes.
I will be aware the next it crash and trying to explain more precisely.
Thanks for the details! I'll keep looking into this, for now please try using the long-press option
(The reason this isn't the default behaviour is in case you are editing documents over a network, where the save could take a long time)
@Simeon - may be related. Firstly I have had a few crashes recently with a project that I have been putting together. It involves multiple print() commands and I think memory requirements were probably exceeded.
The issue I would like to raise was after running Codea, I opened the Codea root folder up in the files app. Whilst playing around in the files app looking for a file Codea bombed out. I will try to reproduce - have you altered the file system within Codea in the latest version?
I'd like to add a data point. I'm on the latest published version of Codea on iPadOS. I've experienced it where Codea seems to have cached an old version of the code and it runs that rather than any changes. If I exit the editor, run another Codea program, and then return to the original one then the code is the old version and my changes are lost. It is intermittent, but there are no crashes involved.
The long press to reveal a "save" option is fantastic - I was going to request a "force save" option to avoid this issue.
@Bri_G what issue did you find in the file system? I haven't altered it, inside the Codea folder there is your documents, and any folders with projects are treated as collections in the UI
@LoopSpace thank you for the extra report. Would you say it happens often? I'll try to track this down
Oh, by the way - thanks for the save then run option, I may use that by default.
@Simeon - just found another issue. After using search and replace, on returning to the editor window, I found several instances of the highlighted search term dotted round my code - in some cases in free space in others overlapping my code.
Just an update: long press save (see @Simeon ‘s comment above, is not fixing my problem...
I just spent a few cycles of tweaking a function, then long-press saving and running, and not seeing results I would expect. Once I added some obvious print statements and didn’t see them, I decided to exit the project and reopen. Sure enough, there was an older version of my code, and that was the version that had been running each time. The code shown in the editor was not what was getting executed. After each run attempt and return to the editor, I would see my changes in the editor, but none of it would affect program behavior.
The issue is elusive, so still no guaranteed way to reproduce it that I’ve found yet, but - in hopes of this hitting @Simeon ’s radar, I wanted to add one more way that this manifests: Today I made a small change (arg value in rect() call), changed Codea tabs, returned to the first tab, and the arg was the older value. My change went away. No code execution between the tab changes.
And also, as an example, here’s an unfortunately typical situation for me since Codea 3.0:
Today I added some logic when a touch is in the
BEGAN
state. I test by tapping, and nothing. I’ve done this a million times, so I check my code to see if I’ve done anything dumb. Same behavior. Then I add a print statement. Nothing! Then I realize, ok, it’s happening again. I close the project, sometimes close Codea too, and return to my project to find that my tap logic isn’t even there. I have to enter it again.I don’t believe that long tap saving solves this. I’ll be more consistent with its usage, and see. But - I don’t want to have to do that.
Everyone, if you go into Settings and scroll down and tap on Codea, what do you have set for Document Storage. Don’t know if that might be a cause, but it might help track things down. Mine is
On My IPad
and I haven’t noticed any issues. I haven’t been doing theSave and Run
option either.PS. I’m also not doing anything with the Files app with Codea.
I didn’t know about that. Mine was set to
iCloud Drive
(which I don’t even use). I switched it toOn My Ipad
. Feeling optimistic! I’ll let you know how it goes.Thanks @dave1707 for the tip. Mine was also set to
iCloud Drive
and I know that my iCloud was getting full up so that might have been contributory. I've set mine toOn My iPad
and will monitor its behaviour.Initial prognosis: doesn't help.
I switched to 'On My iPad' and I've been editing a project and been hit multiple times by the "not saved" bug.
@LoopSpace I wasn’t sure if that would help or not, but I thought I’d suggest it anyways. How large of a project and how many tabs is your current project. I’ve been trying to cause the problem to see if I can track something down, but I haven’t been able to cause it. Maybe with more info and everyone trying to pin it down, we can find the cause and get it fixed.
Trying to create loss of project data bug, but I can cause a Codea crash consistently. Don’t know if this is related to the project data loss.
Codea Crashed
and asks if you want to share additional information with the developer.@dave1707 It was definitely worth a try. I shall try again as I didn't force-quit Codea between making the change and coding (but my iPad is out of juice so I'm waiting on that).
My current project is 3 tabs, the primary tab is about 500 lines long. It does side-load quite a large amount of code from other projects, though. That shouldn't affect saving because it should save it before trying to run it.
Here’s some code that shows the purpose of the Run & Save option of long pressing the Run icon. Make a change in the prt function and run (not run and save) the code. It displays the code on the screen. Keep tapping the screen to reread the tab and it takes about 10 seconds before the code is actually updated. If you do the Run & Save, the code is updated before its run. I’ve been playing around with this trying to get the bug to show by force closing, causing errors, or anything. But so far I haven’t had any success to get the bug.
PS. I’m wondering if there could be something happening at the time when the code is being updated and something else going on.
PSs. Somehow, Codea has to be interrupted before it can update the current edited code so that the code in some buffer is still there and used ignoring any changes just made.
Not sure if this will explain anything, but if you load this code, then remove the function temp, and run the code which I have coded to crash Codea, after loading the code again, the function temp will still be there. If you do the above steps with Run & Save, then the function temp won’t be there if you removed it.
It takes about 10 seconds for the edited code to be updated. So if you’re in a cycle where you change and run your code quickly and Codea crashes, then your changes won’t be there when you reload it.
Does this seem to mimic the problems somewhat.
Just so everyone knows, the code xx=xx..xx causes Codea to run out of memory and crash.
@Simeon - I know it's low priority, but just letting you know I have seen similar problems with not updating the edited project code in Air code Codea on my browser. It also has a greater tendency to bomb out of Codea. When editing with Air code I tend to exit to the list of projects and run another project before switching back to ensure edits have been adopted - that usually works fine. But, if you don't run another project and return to the edited file the edits have disappeared. I am using Safari on my Mac.
Note also, the tendency to bomb out is usually in the project list window after a short period of time. Could this be down to the same code changes in the latest beta?
Not sure if that’s related, but lately I’ve been experiencing similar problems:
I lost two hours of work yesterday. I suggest everyone until the fix to
@Simeon is it possible to add in the next version a save indicator. If your code is saved, at the top show an “Your code is saved” indicator. Also add a force-save button, where code will be saved, if not automatically before.
I have to admit that I am holding off on most of my projects until this is resolved. It’s unfortunate, considering this is (and I am sure will continue to be) my go-to dev environment for fun at home. I will celebrate when we are past this!
Thanks for this - I'm finding it particularly frustrating of late. Hoping it gets resolved soon
All - just picked up on a techie website that iOS 13 has introduced major bugs, in particular memory management which has caused apps to crash. I assume iPadOS suffers from the same problems. If so, resolution of our recent problems could take a significant time to resolve.
Link below - not sure how reliable it is.
Techie Comment
If code edited, asset picker - opening to edit a shader - crashes the editor.
Codea is not crashing when opening the shaders lab from the start screen.
@Anatoly - sounds like quite a few members have encountered problems with lost code. I've even seen it with Air code. Suggestion for anyone with a PC or Mac - set out your code in an editor then cut and paste to Air code retain your code in the editor files - messy but at least you retain the code in the text editor.
No feedback from @Simeon as yet - must be tough problem.
IOS update installed and no lost code yet. Fingers crossed the issue is resolved.
@West - just installed 13.2.2 but haven’t had chance to check it out yet. Fingers, legs and eyes crossed!!!
Hi @Simeon , hope all is well. Any update on this? I realize that not always what I want is highest priority for others, of course, so I'll try to be patient. That said, I'm hoping to get back the pre-3.0 stability of the editor and code saving. Thanks!
I’ve not had a crash since the iOS update
I'm still getting the code-not-being-saved issue on the latest OS.
Is Codea crashing when you have a problem with the code being saved. So far the only time I notice a problem with the code is when Codea crashes.
I'm not getting any crashes. I'm getting times when changes to the code are not being saved (and so Codea runs an old version of the code - that's usually how I spot it). I have to go out of the current program, load another one, and then go back to the original. Then I have to make all my lost changes again. But no crashes.
@LoopSpace Are you using the
Save and Run
option by long pressing the run icon in the upper right of the editor screen. Are your changes in a tab other than the Main tab. I posted an example some time ago where I showed where changes in a tab other than Main took about 10 seconds before it was updates.@dave1707 I am not currently using the
Save and Run
option because when I did use it then it didn't make any difference. I'll try again to see if that makes a difference with the current version of the OS. My changes are in the Main tab, though.Code loss, with and without crashes, changes beyond the main tab.
Save and run
does not fix the issue for me. Admittedly, this was before the latest iOS update, but I have my doubts that there’s a iOS bug that’s causing filesystem issues here but not elsewhere, with other apps. Codea 3.0 code editor issues also are most likely problems within Codea itself.