Help--Dropbox sync crashes Codea

I’ve just rendered Dropbox useless and Codea dead. I reorganized my directories under Dropbox/Apps/Codea and now whenever I sync, Codea silently crashes. It seems to recognize there were new items there (e.g. “2 items remaining”) but then crashes, returning me to the iPad2’s home screen. I tried rebooting Codea but that didn’t clear the error. Is there some way to tell Codea to forget the Dropbox connection so I can reconnect (hoping that’ll clear the error)? Will uninstalling and reinstalling Codea onto the iPad2 work, or is Dropbox now confused about Codea? The Dropbox app shows the directory/file structure correctly. My app’s useless now. I had planned to demo it to a group of interested people later this week (it’s a science app involving data visualization). I have the latest iOS and Codea updates. TIA for any assistance.

I’ve had issues with crashes before on Dropbox sync too.

You can unlink Dropbox by clicking the settings cog in the top right of the main menu in codea.

I thought I had seen an “unlink” somewhere. Anyway, I tried it, and it reset–partially. Before my troubles, I could refer to a file like Dropbox/Apps/Codea/myproject/subdir/file.png. My problems started when I renamed “myproject” to “MyProject”. Maybe I didn’t wait long enough for Dropbox to propagate fully. Whatever happened, I couldn’t access anything anymore.

After unlinking and relinking (thanks for the tip), though, I can now refer to a file Dropbox/Apps/Codea/MyProject/file.png, and I can make the subdirectory “subdir” and sync it successfully too (it doesn’t crash), but any attempt to put files in the subdirectory and sync that crashes Codea.

At least I can access some of Dropbox. I had asked in an earlier thread whether sprite files could be created in subdirs, I was told yes, I tried a sample sprite file at that directory level, and it worked. Then I did this. I’m wondering if it’d be worth uninstalling and reinstalling Codea, but that would lose all my programs, so I’ll probably hold off that experiment until after my demo. If anyone has any other suggestions, I’m all ears.

My gut feeling is that if you hit sync to drop box in codea and while it is syncing you come out of it (before it is complete) there is a possibility that you may corrupt some of the files. I have a bunch of corrupt png files in my Dropbox folder and I only used Dropbox for codea, sprite something and my phone auto backups. As it is only the files in the codea directory then this is the prime suspect. However, I have no evidence and am unable (well unwilling as I don’t want to risk messing more files up) to try to recreate it so it’s just a feeling.

Anyway, my suggestion would be to create a brand new subdirectory (new name) with the required files in it and point your code to the new directory and delete the old one. Secondly when syncing always allow it to run its full course (when I had crashing out mid sync before I got suspicious about the ipad entering sleep mode so kept it active during sync). Thirdly I would keep backups of your important projects (I long hold, copy project and email it to myself) though there are other backup via git hub options available. This lets you uninstall and reinstall codea if you think this will help.

Thanks for the comments. I think it’s more than corrupt files, though.

Assume I’m syncing at the proper times. I had copied over 6 (out of 7) .png files into my Dropbox/Apps/Codea/MyProject directory and could read them successfully in my program. Then I copied over the 7th file “sprite7.png”, and Codea fails to read it. (All 7 were in Dropbox when the bug occurred.) I didn’t really think it was a bad file, but I went back and regenerated it, then put it in the Dropbox directory–fails. I created a completely different file from scratch, gave it the name “doodle.png”, saved it to the directory–Codea reads it. I renamed it “sprite7.png”, fails. I renamed the actual “sprite7.png” to “doodle.png” then copied it to the Dropbox directory–Codea reads it. Renamed it back to “sprite7.png”–Codea fails to read it (but at least it’s not crashing).

It looks to me like Codea has retained some of the pathnames that existed from before the bad sync and reuses them somehow, and this persists even between separate invocations of Codea or setting/resetting Dropbox. Clearly it could read the file–as long as I gave it a different name. Why it didn’t get confused on all 7 files, I don’t know.

I hope @Simeon is looking in. I’d like to know his opinion on what’s going on.

@Simeon have say : “We will be changing the sync implementation in a future release, it should make it a lot more stable.”

Interesting discussion you had there, @HyroVitalyProtago. I hope the “future release” is the next one. Filenames becoming invalid is certainly serious. In my case the filenames encode pieces of information used by the visualization, so they’re not something completely arbitrary that can be easily renamed.

I hope too… In the meantime, when you sync dropbox, wait 10-30s when you watch dropbox have terminated before exit sprite picker. Usually, is sufficient to avoid problem.