Skip to content

Say whether a rebuilt tab had unsaved changes - #1087

Merged
saworbit merged 11 commits into
mainfrom
fix/say-discarded-unsaved
Sep 30, 2026
Merged

saworbit merged 11 commits into
mainfrom
fix/say-discarded-unsaved

Conversation

@saworbit

Copy link
Copy Markdown
Owner

Fixes #1082

Stacked on #1086, #1085, #1084 and #1083. Their commits show here until they merge.

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. overwrite: true is the consent. But the answer said only editor_scene_reloaded: true, so an edit someone had open in that tab was thrown away with nothing naming it.

reloadOpenSceneTab now reads the editor's unsaved list before it rebuilds, and the rebuilt tab's result carries scene_discarded_unsaved. The single-file writers carry it into their answer as editor_scene_discarded_unsaved: true or false on Godot 4.7, and null before it, where the engine cannot say. A writer that rebuilt no tab says nothing about it.

Tests:

  • Tools.RebuildSaysWhetherItDiscardedUnsavedChanges covers true, false and null, and a writer that rebuilt nothing. It fails with the field removed from the answer.
  • The harness pack block now makes an unsaved edit on the target's tab before the pack, and reads the field: true on 4.7.2, null on 4.5.1 and 4.6.2. The create-over-tab block reads false on 4.7.2 for its two saved tabs.

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.

An editor opens the scenes it restores, or the project's main scene, once
its first scan is applied, and makes one of them current. A scene_open
answered before then was replaced a moment later, and every later scene
call acted on the main scene.

scene.open and scene.create now wait at the front of the queue until the
editor's file index is populated, which is the same moment on 4.5.1,
4.6.2 and 4.7.2. Commands behind them wait too, so nothing overtakes them.

Adds a native test for the hold, a live test CI runs on each line, and a
vibe probe that reproduces the switch.
scene_create over a scene open in another tab rebuilt the tab and then
opened it in the same request. On 4.5 and 4.6 the editor ignores a scene
change for the rest of a frame in which it rebuilt one, so a tab right of
the current one never came to the front and the call answered
opened: false.

The bridge now makes the tab current first and says it is stale, and the
server rebuilds it on a later request through resource.refreshCached, the
reload every other writer uses. The previous scene is read before anything
moves it, so previous_scene_file_path is right on those lines too.
csharp_check_build runs dotnet --version before the build, and that
probe stopped at a fixed 30 seconds whatever timeout_seconds said. A
probe that ran out answered 503 toolchain_unavailable, not retryable,
and told the caller to install an SDK that was there. It turned main's
4.7.2 job red, and this branch's parent's 4.5.1 job.

The probe now runs under timeout_seconds, and running out of it answers
504 timeout, retryable, with timeout_seconds in the data.
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.
The 4.6.2 job on #1084 saw scene_open end in peer_closed after 5.7 s,
with the editor alive, and the test had sent the editor output nowhere.
It now keeps it with the extension at INFO, and a failure prints it with
the sessions the server lists.
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.
@github-actions github-actions Bot added documentation Improvements or additions to documentation ci Workflows, automation, and the release gate tests Test suites and the contracts they assert addon The Godot addon and the in-engine GDExtension tooling Generators, harnesses, and developer tooling labels Sep 30, 2026
@saworbit
saworbit merged commit e8b82d3 into main Sep 30, 2026
28 checks passed
@saworbit
saworbit deleted the fix/say-discarded-unsaved branch September 30, 2026 06:56
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 ci Workflows, automation, and the release gate documentation Improvements or additions to documentation tests Test suites and the contracts they assert tooling Generators, harnesses, and developer tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Editor sync] Say when a tab rebuilt under overwrite had unsaved changes

1 participant