File tree Expand file tree Collapse file tree
apps/files_external/lib/Lib/Storage Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -336,6 +336,26 @@ public function stat(string $path): array|false {
336336 return $ stat ;
337337 }
338338
339+ #[\Override]
340+ public function getMetaData (string $ path ): ?array {
341+ $ data = parent ::getMetaData ($ path );
342+ if ($ data !== null && $ data ['mimetype ' ] === FileInfo::MIMETYPE_FOLDER ) {
343+ // Common::getMetaData sets storage_mtime = mtime, but for S3 virtual directories
344+ // mtime may have been updated by mtime propagation while storage_mtime should
345+ // reflect the actual last storage change. Without this override the scanner sees
346+ // data['storage_mtime'] != cacheData['storage_mtime'] and re-writes the cache,
347+ // causing View::getCacheEntry to trigger propagateChange on every read.
348+ $ path = $ this ->normalizePath ($ path );
349+ $ cacheEntry = $ this ->getCache ()->get ($ this ->getCachePath ($ path ));
350+ if ($ cacheEntry instanceof CacheEntry) {
351+ $ data ['storage_mtime ' ] = $ cacheEntry ->getStorageMTime ();
352+ } elseif (!$ this ->isRoot ($ path ) && $ directoryMarker = $ this ->headObject ($ path . '/ ' )) {
353+ $ data ['storage_mtime ' ] = strtotime ($ directoryMarker ['LastModified ' ]);
354+ }
355+ }
356+ return $ data ;
357+ }
358+
339359 #[\Override]
340360 public function is_dir (string $ path ): bool {
341361 $ path = $ this ->normalizePath ($ path );
You can’t perform that action at this time.
0 commit comments