Improve fix for corrupted font resource loading in older documents - #4482
Merged
Conversation
Contributor
There was a problem hiding this comment.
2 issues found across 5 files
Confidence score: 2/5
node-graph/nodes/gstd/src/platform_application_io.rsnow panics when platform application IO or resource data is missing, turning an expected missing-resource case into a user-facing crash—restore the graceful empty-Resourcefallback.node-graph/graph-craft/src/application_io/resource/opfs.rsretains theon_diskmarker after a background OPFS write fails, so laterstorecalls skip retries and the resource can be lost after reload—clear the marker or schedule a retry.
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="node-graph/graph-craft/src/application_io/resource/opfs.rs">
<violation number="1" location="node-graph/graph-craft/src/application_io/resource/opfs.rs:158">
P2: When a newly stored hash's background OPFS write fails, retaining `on_disk` prevents later `store` calls from retrying it, leaving the resource only in `cache` and risking its loss after reload. Clear the marker or schedule a retry when the write fails.</violation>
</file>
<file name="node-graph/nodes/gstd/src/platform_application_io.rs">
<violation number="1" location="node-graph/nodes/gstd/src/platform_application_io.rs:273">
P1: The `resource` node now panics when the platform application IO is absent or a resource's data is missing, instead of returning the previous graceful empty-`Resource` fallback. A missing resource is exactly the case this PR targets (older documents with corrupted/evicted font data), and on the WASM target a `panic!` aborts the whole application rather than degrading the single resource. Restore graceful handling: log the error and return `Resource::empty()` as before.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| }; | ||
|
|
||
| let application_io = editor_api.into_element().application_io.as_ref().expect("ApplicationIo must be available when using resources"); | ||
| let resource = application_io.load_resource(hash).await.unwrap_or_else(|| panic!("Resource {hash} not found")); |
Contributor
There was a problem hiding this comment.
P1: The resource node now panics when the platform application IO is absent or a resource's data is missing, instead of returning the previous graceful empty-Resource fallback. A missing resource is exactly the case this PR targets (older documents with corrupted/evicted font data), and on the WASM target a panic! aborts the whole application rather than degrading the single resource. Restore graceful handling: log the error and return Resource::empty() as before.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At node-graph/nodes/gstd/src/platform_application_io.rs, line 273:
<comment>The `resource` node now panics when the platform application IO is absent or a resource's data is missing, instead of returning the previous graceful empty-`Resource` fallback. A missing resource is exactly the case this PR targets (older documents with corrupted/evicted font data), and on the WASM target a `panic!` aborts the whole application rather than degrading the single resource. Restore graceful handling: log the error and return `Resource::empty()` as before.</comment>
<file context>
@@ -269,19 +269,8 @@ pub async fn resource<'a: 'n>(
- };
-
+ let application_io = editor_api.into_element().application_io.as_ref().expect("ApplicationIo must be available when using resources");
+ let resource = application_io.load_resource(hash).await.unwrap_or_else(|| panic!("Resource {hash} not found"));
Item::new_from_element(resource)
}
</file context>
This reverts commit 404d9f3.
…le Polyline nodes
timon-schelling
force-pushed
the
improve-resource-fixes
branch
from
August 28, 2026 22:32
0239846 to
03e1604
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
improvements of 404d9f3