ldtk icon indicating copy to clipboard operation
ldtk copied to clipboard

[Bug] Crashes when saving large projects with separated levels back-to-back

Open chosencharacters opened this issue 2 years ago • 10 comments

Currently there is a crash that consistently happens if:

  1. You have a large project (Renaine has 600+ levels)
  2. You save
  3. You save again

The crash is due to LDTK deleting all the files then saving them again. The crash causes you to lose any files that were interupted mid save (usually around 50%+)

The only way to recover is if a crash recovery was created, or rewinding using Dropbox/Git/A similar service

Could there be a warning if all the files haven't been released yet before saving?

Alternatively, can LDTK only save files that have been changed? This would reduce the saving time if possible.

chosencharacters avatar Jan 25 '23 01:01 chosencharacters

I can provide a test project if needed! This is confirmed to work on two computers with high end settings (current laptop is 12th gen i7.)

chosencharacters avatar Jan 25 '23 01:01 chosencharacters

I could not reproduce locally, even with a very large project 🤔

Do you have more info about your exact situation:

  • are you using External Levels option?
  • what do you mean by "save again"? Hit CTRL-S during the current save operation, or simply right after the first one terminated?

deepnight avatar Apr 26 '23 15:04 deepnight

Sorry I never replied to this:

  • Yes I am using the External Levels option
  • This is for saving shortly after saving

Here is a video, in this case it only triggered after saving twice but it usually triggers after saving just once

https://github.com/deepnight/ldtk/assets/22716528/20ec2b38-91b0-4588-a5c0-30cef6b0961e

chosencharacters avatar May 10 '23 15:05 chosencharacters

Also worth noting it usually creates a crash recovery but this time it didn't and it also deleted every single other level

chosencharacters avatar May 10 '23 15:05 chosencharacters

Thanks for the video, it helps a lot!

I have a potential culprit here: Dropbox. There's a very good chance that after saving, it tries to sync the files immediately, effectively locking there access for next save operations.

I should add a better error detection here, but that won't really fix the issue itself (2 different apps try to read/write the same files at the same time).

Could you try disabling/closing Dropbox during your tests and see if this happen again?

deepnight avatar May 10 '23 19:05 deepnight

I'll try that, but could there be instead a error catch and try later sort of deal. Dropbox is also the only thing protecting me from when this error hits, as it's automatic (I use git as well, but you have to commit that)

On Wed, May 10, 2023 at 3:02 PM Sébastien Bénard @.***> wrote:

Thanks for the video, it helps a lot!

I have a potential culprit here: Dropbox. There's a very good chance that after saving, it tries to sync the files immediately, effectively locking there access for next save operations.

I should add a better error detection here, but that won't really fix the issue itself (2 different apps try to read/write the same files at the same time).

Could you try disabling/closing Dropbox during your tests and see if this happen again?

— Reply to this email directly, view it on GitHub https://github.com/deepnight/ldtk/issues/831#issuecomment-1542665717, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFNKA4GCPIBOZ6IWHOMWAPTXFPQ4PANCNFSM6AAAAAAUFX5A7Y . You are receiving this because you authored the thread.Message ID: @.***>

chosencharacters avatar May 10 '23 19:05 chosencharacters

Dropbox is also the only thing protecting me from when this error

Right, but if it's also the source of the error (which needs to be verified first, of course), then... well 🤷

deepnight avatar May 13 '23 21:05 deepnight

Well, to me, it's like, if Dropbox is the source (and it's terrifying for me to check this because you're asking me to work for a while without Dropbox and if it's not the source then my entire game goes poof) it doesn't really matter. To me the question is more are we hard crashing on this error which seems like it could be fixed by waiting a few seconds before trying again if we get the error instead of hard crashing and deleting everything.

On Sat, May 13, 2023 at 5:11 PM Sébastien Bénard @.***> wrote:

Dropbox is also the only thing protecting me from when this error

Right, but if it's also the source of the error (which needs to be verified first, of course), then... well 🤷

— Reply to this email directly, view it on GitHub https://github.com/deepnight/ldtk/issues/831#issuecomment-1546750411, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFNKA4CTBRPKHZ5OBCHUHGDXF72HJANCNFSM6AAAAAAUFX5A7Y . You are receiving this because you authored the thread.Message ID: @.***>

chosencharacters avatar May 15 '23 23:05 chosencharacters

You may want to simply enable LDtk backups to avoid any loss like that. Please, bear in mind that I'm not saying I won't fix, I'm just asking for a check to identify the source of the problem.

deepnight avatar May 16 '23 07:05 deepnight

I do have them enabled, but there's a 33% chance they don't work and I have to do a Dropbox rewind

On Tue, May 16, 2023 at 3:24 AM Sébastien Bénard @.***> wrote:

You may want to simply enable LDtk backups to avoid any loss like that. Please, bear in mind that I'm not saying I won't fix, I'm just asking for a check to identify the source of the problem.

— Reply to this email directly, view it on GitHub https://github.com/deepnight/ldtk/issues/831#issuecomment-1549139091, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFNKA4FJLETCL7DU4CGQU23XGMTUTANCNFSM6AAAAAAUFX5A7Y . You are receiving this because you authored the thread.Message ID: @.***>

chosencharacters avatar May 16 '23 07:05 chosencharacters