Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exported Node Array loses its contents if scene is reloaded during invalid script #96715

Open
RedMser opened this issue Sep 8, 2024 · 4 comments

Comments

@RedMser
Copy link
Contributor

RedMser commented Sep 8, 2024

Tested versions

Reproduced in 4.3-stable

System information

Godot v4.3.stable - Windows 10.0.19044 - GLES3 (Compatibility) - NVIDIA GeForce RTX 2080 (NVIDIA; 32.0.15.5585) - Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz (12 Threads)

Issue description

If a script exports an Array[Node], its contents will be lost if the script has an error and the scene file is reloaded in the editor.
This can also happen when using external editor to write the script, but is likely the same issue.

I also tried the same with float and Array[int], but everything gets remembered properly in these cases.

24-09-08_17-04-01_Godot_v4.3-stable_win64_Fritillarybutterfly.mp4

Steps to reproduce

If you download the MRP, you can skip step 1 and 2.

  1. Create a script with @export var breaks: Array[Node] = [] in it.
  2. Assign script to a node in scene, give the array contents, save the scene.
  3. Introduce a parse error into the script (e.g. add func to the end of the file) and save.
  4. Reload the scene using "Scene -> Reload Saved Scene".
  5. Remove the error introduced in 3. and observe the exported node array being empty now.

Minimal reproduction project (MRP)

node-array-scene-restore.zip

@matheusmdx
Copy link
Contributor

Bisecting points to #78240 as the culprit, @KoBeWi

image

@KoBeWi
Copy link
Member

KoBeWi commented Sep 18, 2024

Well reverting #78240 makes it work correctly. I tried to test whether it brings back #78238, but I was stopped by this new regression: #97153

@RedMser
Copy link
Contributor Author

RedMser commented Nov 14, 2024

Note that the linked regression issue has been fixed. I also confirmed that this bug is still reproducible in v4.4 [c6c464c]

@KoBeWi
Copy link
Member

KoBeWi commented Nov 14, 2024

Looks like #78240 can be safely reverted now.
Typed Dictionary might have the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants