mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 14:18:04 +08:00
Improve fix for corrupted font resource loading in older documents (#4482)
* Revert "Fix corrupted font resource loading in older documents"
This reverts commit 404d9f3047.
* Fix migrations for the Read Vector, Dot Product, Query JSON, and Sample Polyline nodes
* Fix text node migrations
* Provide resource storage to the resource message handler
* Refetch resources whose stored bytes are missing
* Add test for refetching resources with missing bytes
This commit is contained in:
@@ -153,9 +153,6 @@ async fn drain_queue(inner: Arc<Mutex<Inner>>) {
|
||||
Mutation::Write { hash, bytes } => {
|
||||
if let Err(error) = write_file(&directory, &hash, &bytes).await {
|
||||
log::error!("OPFS write for {hash} failed: {error:?}");
|
||||
|
||||
// Nothing reached disk, so leaving the hash listed would claim a file that later sessions cannot read
|
||||
inner.lock().unwrap().on_disk.remove(&hash);
|
||||
}
|
||||
}
|
||||
Mutation::Delete { hash } => {
|
||||
|
||||
@@ -276,7 +276,6 @@ pub async fn resource<'a: 'n>(
|
||||
return placeholder();
|
||||
};
|
||||
|
||||
// Stored bytes go missing when the browser evicts its storage or a write is interrupted
|
||||
let Some(resource) = application_io.load_resource(hash).await else {
|
||||
log::error!("Resource {hash} was not found in storage");
|
||||
return placeholder();
|
||||
|
||||
Reference in New Issue
Block a user