Fix: Renderer fails to recover from type error after undo#3859
Fix: Renderer fails to recover from type error after undo#3859jsjgdh wants to merge 2 commits intoGraphiteEditor:masterfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refactors the error handling within the node graph executor to improve robustness and consistency. Instead of immediately exiting the evaluation process upon encountering an error, the system now captures and defers error propagation. This ensures that all available messages are processed and that error-related responses are dispatched only at the conclusion of the evaluation cycle, leading to more stable state management. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request refactors error handling in poll_node_graph_evaluation to process all available responses from the node graph runtime, rather than returning on the first error. This is a positive change for robustness. However, I've identified a critical bug in the new implementation where a successful response can incorrectly clear an error state from a preceding failed response, potentially masking failures. I've provided suggestions to fix this. Additionally, I've included a suggestion to simplify the final error handling logic for better clarity.
|
/gemini review |
There was a problem hiding this comment.
Code Review
The pull request refactors the error handling within the poll_node_graph_evaluation function, introducing a graph_render_error flag for better state management and recovery. It centralizes error propagation by deferring the return of an Err until the end of the function, allowing for processing of all responses in a batch. My feedback focuses on improving the consistency and completeness of error reporting, as well as removing redundant message dispatches. These improvements aim to make error diagnostics more comprehensive and the code cleaner.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request refactors the error handling in the node graph executor to make it more resilient, preventing it from halting on the first error. It also includes a fix for providing default values for node inputs. The changes are generally good, but I've identified a couple of areas for improvement in terms of code readability and maintainability.
editor/src/messages/portfolio/document/utility_types/network_interface.rs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
1 issue found across 1 file
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="editor/src/node_graph_executor.rs">
<violation number="1" location="editor/src/node_graph_executor.rs:58">
P2: `last_svg_canvas` is never set to `Some(...)` anywhere in the codebase, making the field dead code and every `self.last_svg_canvas = None` assignment a no-op. If this field is intended to retain a `SurfaceFrame` reference to keep a canvas surface alive (e.g., between renders), the code that populates it appears to be missing.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
editor/src/node_graph_executor.rs
Outdated
| futures: VecDeque<(u64, ExecutionContext)>, | ||
| node_graph_hash: u64, | ||
| previous_node_to_inspect: Option<NodeId>, | ||
| last_svg_canvas: Option<SurfaceFrame>, |
There was a problem hiding this comment.
P2: last_svg_canvas is never set to Some(...) anywhere in the codebase, making the field dead code and every self.last_svg_canvas = None assignment a no-op. If this field is intended to retain a SurfaceFrame reference to keep a canvas surface alive (e.g., between renders), the code that populates it appears to be missing.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At editor/src/node_graph_executor.rs, line 58:
<comment>`last_svg_canvas` is never set to `Some(...)` anywhere in the codebase, making the field dead code and every `self.last_svg_canvas = None` assignment a no-op. If this field is intended to retain a `SurfaceFrame` reference to keep a canvas surface alive (e.g., between renders), the code that populates it appears to be missing.</comment>
<file context>
@@ -55,6 +55,8 @@ pub struct NodeGraphExecutor {
futures: VecDeque<(u64, ExecutionContext)>,
node_graph_hash: u64,
previous_node_to_inspect: Option<NodeId>,
+ last_svg_canvas: Option<SurfaceFrame>,
+ graph_render_error: bool,
}
</file context>
Regression of #3783 .