You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by xu...@apache.org on 2025/04/06 14:17:11 UTC

(opendal) branch main updated: fix(services/ipmfs): fix Ipmfs behavior tests (#5969)

This is an automated email from the ASF dual-hosted git repository.

xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opendal.git


The following commit(s) were added to refs/heads/main by this push:
     new 6d2a09ee2 fix(services/ipmfs): fix Ipmfs behavior tests (#5969)
6d2a09ee2 is described below

commit 6d2a09ee2d14317eef089f26966f4f022d85f4cf
Author: miro <hi...@miro.im>
AuthorDate: Sun Apr 6 22:17:05 2025 +0800

    fix(services/ipmfs): fix Ipmfs behavior tests (#5969)
    
    fix(services/ipmfs): fix IPMFS behavior tests
---
 core/src/services/ipmfs/lister.rs | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/core/src/services/ipmfs/lister.rs b/core/src/services/ipmfs/lister.rs
index 63e1bc420..292b0a9f5 100644
--- a/core/src/services/ipmfs/lister.rs
+++ b/core/src/services/ipmfs/lister.rs
@@ -25,6 +25,7 @@ use super::backend::IpmfsBackend;
 use super::error::parse_error;
 use crate::raw::*;
 use crate::EntryMode;
+use crate::ErrorKind;
 use crate::Metadata;
 use crate::Result;
 
@@ -49,7 +50,22 @@ impl oio::PageList for IpmfsLister {
         let resp = self.backend.ipmfs_ls(&self.path).await?;
 
         if resp.status() != StatusCode::OK {
-            return Err(parse_error(resp));
+            let err = parse_error(resp);
+            if matches!(err.kind(), ErrorKind::NotFound) {
+                // treat as empty listing
+                ctx.done = true;
+                return Ok(());
+            }
+            return Err(err);
+        }
+
+        // Add current directory entry when processing the first page
+        if ctx.token.is_empty() && !ctx.done {
+            let path = build_abs_path(&self.root, self.path.as_str());
+            let path = build_rel_path(&self.root, &path);
+
+            ctx.entries
+                .push_back(oio::Entry::new(&path, Metadata::new(EntryMode::DIR)));
         }
 
         let bs = resp.into_body();