Bug description
The iOS app repeatedly rebuilds the Media tab index from scratch, even though the local app data/cache is still present.
I have a large media library with tens of thousands of images/videos. After the Media tab has already finished indexing/caching media once, opening the app or entering the Media tab sometimes shows the media cache/index starting again from 0, as if no media had been cached before.
However, iOS storage still shows that Nextcloud keeps several GB of "Documents & Data". This suggests that the actual local cached files/data are not deleted. Instead, the local media index/database or Media tab data source seems to be cleared, reset, or filtered as empty.
Current behavior
- Media tab previously contains a large number of indexed media items.
- After reopening the app or entering the Media tab again, the media count/indexing progress starts from 0.
- The app begins rebuilding the Media tab cache/index again.
- iOS Settings still shows the Nextcloud app has large "Documents & Data" storage usage.
- Therefore, the local cached data appears to still exist, but the Media tab does not reuse it.
Expected behavior
The Media tab should reuse the existing local media index/cache if the cached files and metadata are still present.
A temporary empty server-side SEARCH result, failed request, changed media path, capability mismatch, or network issue should not cause the existing local Media tab data source/index to be cleared.
Actual behavior
The Media tab behaves as if the local media index is empty and starts rebuilding from 0, while the app storage size remains almost unchanged.
Environment
- App: Nextcloud iOS
- Version: 33.0.7
- Device: iPhone
- iOS language: Chinese
- Media library size: tens of thousands of media items
- iOS storage shows:
- App size: about 237.7 MB
- Documents & Data: about 6.89 GB
Possible cause
This looks like an index/database reset rather than an actual cache deletion.
From the code, the Media tab seems to rely on local metadata/data source rather than directly scanning the existing local cached files.
One suspicious area may be the Media tab search/index refresh logic. In NCMediaDataSource.swift, if the full-range media search returns no files, the current data source may be cleared:

Bug description
The iOS app repeatedly rebuilds the Media tab index from scratch, even though the local app data/cache is still present.
I have a large media library with tens of thousands of images/videos. After the Media tab has already finished indexing/caching media once, opening the app or entering the Media tab sometimes shows the media cache/index starting again from 0, as if no media had been cached before.
However, iOS storage still shows that Nextcloud keeps several GB of "Documents & Data". This suggests that the actual local cached files/data are not deleted. Instead, the local media index/database or Media tab data source seems to be cleared, reset, or filtered as empty.
Current behavior
Expected behavior
The Media tab should reuse the existing local media index/cache if the cached files and metadata are still present.
A temporary empty server-side SEARCH result, failed request, changed media path, capability mismatch, or network issue should not cause the existing local Media tab data source/index to be cleared.
Actual behavior
The Media tab behaves as if the local media index is empty and starts rebuilding from 0, while the app storage size remains almost unchanged.
Environment
Possible cause
This looks like an index/database reset rather than an actual cache deletion.
From the code, the Media tab seems to rely on local metadata/data source rather than directly scanning the existing local cached files.
One suspicious area may be the Media tab search/index refresh logic. In
NCMediaDataSource.swift, if the full-range media search returns no files, the current data source may be cleared: