Skip to content

Say whether undo, redo and project code left the scene unsaved - #1088

Merged
saworbit merged 6 commits into
mainfrom
fix/report-history-saved-state
Sep 30, 2026
Merged

saworbit merged 6 commits into
mainfrom
fix/report-history-saved-state

Conversation

@saworbit

Copy link
Copy Markdown
Owner

Fixes #1049

Stacked on #1087, #1086. Their commits show here until they merge.

editor_undo, editor_redo, scene_call_method and a delivered signal_emit said nothing about whether they left the edited scene unsaved, so no save step followed them. Their entries in tests/follow_ups.json were exempt under this issue. A history step can land back on the saved version as well as move off it, and project code can change anything, with or without an undo entry.

A new bridge helper, reportEditedSceneSaved, reads the edited scene against EditorInterface.get_unsaved_scenes after the call and sets scene_saved. The existing follow-up rule turns scene_saved: false into a save step. Before Godot 4.7 the bind does not exist, so the answer carries no scene_saved and a limitation saying the engine cannot tell. It runs after undo and redo, after a delivered emit, and after scene_call_method on both the direct path and a coroutine's completion. An emit that reached no listener ran nothing and says nothing new.

The four move from exempt to leaves: ["save"] with the scene_saved: false fact.

Tests: the harness's existing duplicate, save, undo, redo sequence (requests 2502 to 2506) now reads the answers. On 4.7.2 the undo past the save says scene_saved: false with a save step, and the redo back onto it says true with none. On 4.5.1 and 4.6.2 both carry the limitation and no scene_saved. With the call removed from the undo path, a 4.7.2 run showed neither field, which those assertions catch.

Checked locally: native suite (958), Python suite, docs validator, test inventory, and the live harness on 4.5.1, 4.6.2 and 4.7.2. CHANGELOG updated under Unreleased, Fixed.

With a GODOT_BIN that cannot be started, runtime_launch answered
success: false and exit_code 0, the shape of a game that ran and failed,
and said to put godot on PATH whatever GODOT_BIN named. The other tools
that start their own Godot answer 503 engine_unavailable since #1045.

The test runner now records a spawn Windows refused, and the handler
refuses that, or a POSIX child that exits 127, the same way.
scene_create, scene_pack_branch and viewport_create_test_lab with
overwrite: true rebuild a tab that holds the scene they replace, whatever
it holds, and the answer said only editor_scene_reloaded: true. An edit
someone had open in that tab was thrown away with nothing naming it.

The bridge reads the unsaved list before the rebuild, and the answer now
carries editor_scene_discarded_unsaved: true or false on Godot 4.7, and
null before it, where the engine cannot say.
On a runner with no Godot, runtime_launch now answers 503
engine_unavailable, and the engine identity test expected a success body
with the engine fields. Nothing runs there, so the refusal is the answer;
the test now checks it names the engine it tried.
editor_undo, editor_redo, scene_call_method and a delivered signal_emit
said nothing about the saved state, so no save step followed them, and
their follow-up entries were exempt under #1049. A history step can land
back on the saved version as well as move off it, and project code can
change anything.

On Godot 4.7 their answers now read the edited scene against the
unsaved list and carry scene_saved, which the existing rule turns into a
save step when it is false. Before 4.7 they carry a limitation saying
the engine cannot tell. The four move from exempt to leaves: ["save"].
@github-actions github-actions Bot added documentation Improvements or additions to documentation tests Test suites and the contracts they assert addon The Godot addon and the in-engine GDExtension labels Sep 30, 2026
@saworbit
saworbit merged commit 591b0cc into main Sep 30, 2026
28 checks passed
@saworbit
saworbit deleted the fix/report-history-saved-state branch September 30, 2026 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

addon The Godot addon and the in-engine GDExtension documentation Improvements or additions to documentation tests Test suites and the contracts they assert

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Follow-ups] Report whether undo, redo and project code left the scene unsaved

1 participant