I encountered a bug in C3 while saving the project. I had an image named "SpriteTest" in C3, which I then renamed to "EnemySprite" directly within the layout. After making some changes in the event sheet, I hit the save button, waited a few seconds for the save to complete, committed it to git, and then shut down my machine. However, today when I opened the project, I was greeted with the following error message:
"Failed to open project. Check if it is a valid Construct 3 folder project."
I pressed F12 to open the browser console and found something interesting. The sprite "EnemySprite" (the one I renamed from "SpriteTest") wasn't saved, and I encountered this error:
"projectResources.js:583 Failed to read file 'images\enemysprite-animation 1-000.png': DOMException: A requested file or directory could not be found at the time an operation was processed."
I quickly verified the git commit and the project folder. I was confirmed that the "EnemySprite" sprite wasn't saved. The previous "SpriteTest" sprite was still present in the images directory.
After renaming the old sprite to "EnemySprite," the event sheet updated with all the relevant code involving the "EnemySprite." However, upon saving, C3 didn't update the image directory but saved all the changes in the layout and event sheet. When I examined the git commit history, I confirmed that "layout.json,", "eventsheet.json,", "project.c3proj," and "project.uistate.json" were all updated, yet there was no indication of "SpriteTest" being renamed to "EnemySprite."
When attempting to replicate the issue, I couldn't do so. It seems to be random, but I stumbled upon a community post where people faced the same problem.
I'm asking the more experienced users: Have any of you faced this before? Can it be avoided? Since it's not easy to recreate, fixing it might be tough for the C3 team. But if anyone manages to reproduce it, please report the issue.
By the way, Thanks to DOP2000. His post literally saved my project from corruption.
Edit: Someone in GitHub posted a similar bug (the error occurred when the layer is deleted).