Open hsandt opened 3 months ago
I'm not sure how this would be reliably solved as the script stops having these exports, and how to handle the values being kept around until the errors are resolved
Also please just confirm with 4.2.2 (and please try making reports with a supported version)
When I just started with Godot, I had issues where I had cyclical references. These were my own fault/mistakes, but Godot didn't tell/warn me about this so I had a hard time tracking/understanding odd behavior: Files were corrupting themselves. I would have a working setup, code more, save it, play, get errors, and suddenly files were (half) empty and corrupted. Sounds familiar? ;)
So two things:
OK, considering I don't have an exact repro and can only check it over a long period of time on a real project, I cannot confirm for v4.3.rc2 yet, so I will wait to upgrade my project to v4.3 and then I'll be able to tell if it happens again.
Yes, circular deps are one possible cause to make parsing fail, but I think I also had this issue with other types of things breaking parsing temporarily.
Tested versions
System information
Godot v4.2.1.stable - Ubuntu 22.04.4 LTS 22.04 - X11 - Vulkan (Mobile) - dedicated NVIDIA GeForce GTX 860M (nvidia; 535.161.07) - Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz (8 Threads)
Issue description
While I'm working on a script, I generally reach a state where the script becomes invalid, such as messing up with indentation or removing used variables. This causes a temporary Parser Error, which is not a big deal.
However, I found out that in some situations, this will cause a bunch of members on nodes using my script to suddenly become null (I generally use scene instances, if that matters).
I don't know the exact circumstances to reproduce the bug, but since it has happened many times and is the main reason why I need to restart Godot (along with spurious persistent parser errors that stay cached until I restart), and found so similar bug here, I decided to open one. Unfortunately this is hard to reproduce specifically when you want to, on simple code; it just happens if you work on a project long enough, on code that is complex enough... But I hope that having an issue will allow developers to start can discussing this and share MWE.
The possible actions needed to cause the bug are:
Variant: instead of null, the members containing NodePath become all cleared to empty NodePaths
And today I got, for the first time, the very weird super complex serialization made of many empty NodePaths:
(cool, GitHub recognizes tscn syntax!)
after modifying some field to make the scene dirty and resave, it turned back to just simple empty NodePaths as in the previous screenshot
Steps to reproduce
Minimal reproduction project (MRP)
Call for help!
It's probably easier to repro on a complex, existing project. Unfortunately the project where I just reproduced the bug is private, but if I can repro on a public one I can just share the repo with you and tell you what I did last. I invite other developers to do the same.