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:
Timon
2026-08-29 02:01:37 +02:00
committed by GitHub
parent c2afc07a04
commit d5bb887b79
5 changed files with 31 additions and 70 deletions

View File

@@ -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 } => {

View File

@@ -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();