From 786fc7ebd540ad708c0092c4a3621657b3151265 Mon Sep 17 00:00:00 2001 From: crwen <1543720935@qq.com> Date: Tue, 14 Jan 2025 21:09:23 +0800 Subject: [PATCH 1/2] fix: return full path in opfs list --- fusio/src/impls/disk/opfs/fs.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fusio/src/impls/disk/opfs/fs.rs b/fusio/src/impls/disk/opfs/fs.rs index 1307d0c..5692f4a 100644 --- a/fusio/src/impls/disk/opfs/fs.rs +++ b/fusio/src/impls/disk/opfs/fs.rs @@ -102,8 +102,8 @@ impl Fs for OPFS { .await; Ok(stream! { - for path in entries { - yield Ok(FileMeta{ path: path.into(), size: 0 }) + for entry in entries { + yield Ok(FileMeta{ path: path.child(entry), size: 0 }) } }) } From bbce12b0e0fa76fbae4fdff89f1842c7500b8ccd Mon Sep 17 00:00:00 2001 From: crwen <1543720935@qq.com> Date: Tue, 14 Jan 2025 21:31:18 +0800 Subject: [PATCH 2/2] fix test case --- fusio/tests/opfs.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fusio/tests/opfs.rs b/fusio/tests/opfs.rs index f4682a0..5a2f7f7 100644 --- a/fusio/tests/opfs.rs +++ b/fusio/tests/opfs.rs @@ -62,7 +62,7 @@ pub(crate) mod tests { let base_path = Path::from_opfs_path("test_opfs_dir".to_string()).unwrap(); let mut stream = fs.list(&base_path).await.unwrap(); - let expected = ["sub_dir", "file"]; + let expected = ["test_opfs_dir/sub_dir", "test_opfs_dir/file"]; let mut result_len = 0; while let Some(Ok(meta)) = stream.next().await { assert!(expected.contains(&meta.path.as_ref())); @@ -74,7 +74,7 @@ pub(crate) mod tests { .await .unwrap(); - let expected = ["sub_dir"]; + let expected = ["test_opfs_dir/sub_dir"]; let mut result_len = 0; let mut stream = fs.list(&base_path).await.unwrap(); while let Some(Ok(meta)) = stream.next().await {