Export the async-source flag from the macro and dispatch superseded type deltas in tests

This commit is contained in:
Dennis Kobert
2026-08-04 13:15:28 +02:00
parent 88795ff659
commit 11c9ffa301
7 changed files with 31 additions and 69 deletions
+9 -4
View File
@@ -53,11 +53,16 @@ impl EditorTestUtils {
}
runtime.run().await;
// An async source reports `Pending` on the evaluation that starts it and marks the runtime dirty
// once it completes, so the value only reaches the render on a follow-up evaluation. That first
// response is superseded, so it is drained rather than asserted on.
// An async source reports `Pending` on the evaluation that starts it and marks the runtime dirty once
// it completes, so the value only reaches the render on a follow-up evaluation. The superseded response's
// `Pending` error is ignored, but its messages carry the incremental resolved-types delta and must be
// dispatched, or the editor's type map desyncs permanently.
while runtime.take_dirty() {
let _ = editor.poll_node_graph_evaluation(&mut VecDeque::new());
let mut superseded_messages = VecDeque::new();
let _ = editor.poll_node_graph_evaluation(&mut superseded_messages);
for message in superseded_messages {
editor.handle_message(message);
}
let portfolio = &mut editor.dispatcher.message_handlers.portfolio_message_handler;
let (executor, documents) = (&mut portfolio.executor, &mut portfolio.documents);