3636use  OCP \SystemTag \TagNotFoundException ;
3737use  OCP \WorkflowEngine \ICheck ;
3838use  OCP \WorkflowEngine \IFileCheck ;
39+ use  OC \Files \Storage \Wrapper \Wrapper ;
3940
4041class  FileSystemTags implements  ICheck, IFileCheck {
4142	use  TFileCheck;
@@ -132,13 +133,26 @@ protected function getSystemTags() {
132133	 * @return int[] 
133134	 */ 
134135	protected  function  getFileIds (ICache $ cache$ path$ isExternalStorage
135- 		// TODO: Fix caching inside group folders 
136- 		// Do not cache file ids inside group folders because multiple file ids might be mapped to 
137- 		// the same combination of cache id + path. 
138136		/** @psalm-suppress InvalidArgument */ 
139- 		$ shouldCacheFileIds$ this storage ->instanceOfStorage (\OCA \GroupFolders \Mount \GroupFolderStorage::class);
140- 		$ cacheId$ cachegetNumericStorageId ();
141- 		if  ($ shouldCacheFileIdsisset ($ this fileIds [$ cacheId$ path
137+ 		if  ($ this storage ->instanceOfStorage (\OCA \GroupFolders \Mount \GroupFolderStorage::class)) {
138+ 			// Special implementation for groupfolder since all groupfolders share the same storage 
139+ 			// id so add the group folder id in the cache key too. 
140+ 			$ groupFolderStorage$ this storage ;
141+ 			if  ($ this storage  instanceof  Wrapper) {
142+ 				$ groupFolderStorage$ this storage ->getInstanceOfStorage (\OCA \GroupFolders \Mount \GroupFolderStorage::class);
143+ 			}
144+ 			if  ($ groupFolderStoragenull ) {
145+ 				throw  new  \LogicException ('Should not happen: Storage is instance of GroupFolderStorage but no group folder storage found while unwrapping. ' );
146+ 			}
147+ 			/** 
148+ 			 * @psalm-suppress UndefinedDocblockClass 
149+ 			 * @psalm-suppress UndefinedInterfaceMethod 
150+ 			 */ 
151+ 			$ cacheId$ cachegetNumericStorageId () . '/ '  . $ groupFolderStoragegetFolderId ();
152+ 		} else  {
153+ 			$ cacheId$ cachegetNumericStorageId ();
154+ 		}
155+ 		if  (isset ($ this fileIds [$ cacheId$ path
142156			return  $ this fileIds [$ cacheId$ path
143157		}
144158
@@ -151,12 +165,10 @@ protected function getFileIds(ICache $cache, $path, $isExternalStorage) {
151165
152166		$ fileId$ cachegetId ($ path
153167		if  ($ fileId1 ) {
154- 			$ parentIds$ cache -> getId ( $ path ) ;
168+ 			$ parentIds$ fileId 
155169		}
156170
157- 		if  ($ shouldCacheFileIds
158- 			$ this fileIds [$ cacheId$ path$ parentIds
159- 		}
171+ 		$ this fileIds [$ cacheId$ path$ parentIds
160172
161173		return  $ parentIds
162174	}
0 commit comments