Xuanwo opened a new pull request, #8817:
URL: https://github.com/apache/opendal/pull/8817

   # Which issue does this PR close?
   
   No linked issue.
   
   # Rationale for this change
   
   `SimulateLayer` serves `list(recursive = true)` through `ServicerFlatLister` 
when the backend lacks `list_with_recursive`. The lister opens every discovered 
directory with a non-recursive `list`. On a backend that does not emit a 
self-entry for an empty directory, that listing returns no entries, and the 
lister dropped the directory instead of yielding it.
   
   As a result, `list_with(dir).recursive(true)` omitted empty subdirectories. 
The same omission broke the simulated recursive delete path: 
`delete_with(dir).recursive(true)` never queued the empty directory, so it 
either left it orphaned or let the parent deletion fail on hierarchical stores.
   
   # What changes are included in this PR?
   
   - `ServicerFlatLister` now yields a discovered directory in post-order when 
its non-recursive listing returns no entries. An empty or missing top-level 
prefix still lists as empty, so `list(prefix)` behavior for an empty prefix is 
unchanged.
   - Regression tests cover an empty subdirectory in recursive listing, an 
empty or missing top-level prefix, and simulated recursive delete ordering 
where the empty subdirectory and the other children are deleted before the 
parent.
   
   # Are there any user-facing changes?
   
   Yes. Operators using `SimulateLayer`, including the default `auto-simulate` 
setup, now see empty subdirectories in recursive listings, and simulated 
recursive delete removes them.
   
   # Breaking changes
   
   # AI Usage Statement
   
   - Harness: pi coding agent (T3 Code implementation sub-agent)
   - Model: group/deepseek
   - Effort: max
   - Role: Implemented the fix and regression tests after reproducing the 
failure on `origin/main`, then ran formatting, clippy, and tests. The 
regression was reproduced with the in-repo mock backend; no real service with 
this listing behavior was exercised.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to