Flush queued IDE writes and restart validation after host revision changes

This commit is contained in:
2026-11-13 20:53:22 +01:00
parent 8be0aec287
commit 1856f69637
11 changed files with 284 additions and 2 deletions
@@ -554,6 +554,11 @@ public final class DesignerPane extends BorderPane implements AutoCloseable {
private void load(DocumentSnapshot value) {
if (closed) return;
// A newer host revision can have identical text (edit/revert or native reload).
// Its predecessor's validation reply will be rejected by revision, so it must
// not leave an in-flight marker that absorbs every subsequent render request.
if (draft == null || draft.revision() != value.revision() || !draft.text().equals(value.text()))
invalidateBindings("Document synchronized; target validation outdated.");
loading = true;
layoutPasses = 0;
canvasCommitQueued = false;
@@ -635,6 +640,9 @@ public final class DesignerPane extends BorderPane implements AutoCloseable {
report(error);
} finally {
loading = false;
// The change debounce may already have fired against the previous draft.
// Render only after the authoritative revision and its projection agree.
if (projection != null && examples.getValue() != null) resize.playFromStart();
if (pendingSourceOffset != null) {
int offset = pendingSourceOffset;
pendingSourceOffset = null;