Xuanwo commented on code in PR #5226:
URL: https://github.com/apache/opendal/pull/5226#discussion_r1828635266
##########
core/src/layers/complete.rs:
##########
@@ -174,7 +174,12 @@ impl<A: Access> CompleteAccessor<A> {
}
if path == "/" {
- return Ok(RpStat::new(Metadata::new(EntryMode::DIR)));
+ let meta = if capability.stat {
+ self.inner.stat(path, args).await?.into_metadata()
Review Comment:
Hi, it's intended that we don't send `stat` for `/`. The service should
always make sure `/` exists.
##########
core/src/services/gdrive/lister.rs:
##########
@@ -90,14 +96,30 @@ impl oio::PageList for GdriveLister {
EntryMode::FILE
};
- let root = &self.core.root;
let path = format!("{}{}", &self.path, file.name);
- let normalized_path = build_rel_path(root, &path);
- // Update path cache with list result.
- self.core.path_cache.insert(&path, &file.id).await;
+ // Update path cache with the list result.
+ //
+ // Only cache non-existent entries. When Google Drive converts a
format,
+ // for example, Microsoft PowerPoint, there will be two entries.
+ // These two entries share the same file ID.
+ if let Ok(None) = self.core.path_cache.get(&path).await {
+ self.core.path_cache.insert(&path, &file.id).await;
+ }
- let entry = oio::Entry::new(&normalized_path,
Metadata::new(file_type));
+ let root = &self.core.root;
+ let normalized_path = build_rel_path(root, &path);
+
+ let mut meta = Metadata::new(file_type);
+ // Resetting the metakey is necessary when mode is
`EntryMode::DIR`,
Review Comment:
The underlying cause might be here:
https://github.com/apache/opendal/blob/259a19e66b532a2905bba955749db6b36bf634e9/core/src/types/metadata.rs#L58-L61
It seems reasonable to remove it.
--
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]