Bug when changing the file ordering criteria
⚠️ Before posting ⚠️
- [x] This is a bug, not a question or an enhancement.
- [x] I've searched for similar issues and didn't find a duplicate.
- [x] I've written a clear and descriptive title for this issue, not just "Bug" or "Crash".
- [x] I agree to follow Nextcloud's Code of Conduct.
Steps to reproduce
- Click on the upload button
- Choose any folder
- Change the ordering criteria for the listing files (e.g A-Z -> most recent or viceversa)
Expected behaviour
The file ordering should be modified according to the chosen criteria
Actual behaviour
App crashes, modifications to sorting criteria is not applied, nor the directory within I was searching
Android version
16
Device brand and model
Google pixel 8 pro
Stock or custom OS?
Stock
Nextcloud android app version
3.34.1
Nextcloud server version
31.0.8
Using a reverse proxy?
No
Android logs
Cause of error
Exception in thread "pool-26-thread-1" java.util.ConcurrentModificationException
at java.util.ArrayList.sort(ArrayList.java:1823)
at java.util.Collections.sort(Collections.java:207)
at kotlin.collections.CollectionsKt__MutableCollectionsJVMKt.sortWith(MutableCollectionsJVM.kt:42)
at com.owncloud.android.utils.FileSortOrderByDate.sortLocalFiles(FileSortOrderByDate.kt:51)
at com.owncloud.android.ui.adapter.LocalFileListAdapter.lambda$setSortOrder$6(LocalFileListAdapter.java:392)
at com.owncloud.android.ui.adapter.LocalFileListAdapter.$r8$lambda$WTDJyclhOx9wYl9P9c9Mv0A876o(Unknown Source:0)
at com.owncloud.android.ui.adapter.LocalFileListAdapter$$ExternalSyntheticLambda3.run(D8$$SyntheticClass:0)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1156)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:651)
at java.lang.Thread.run(Thread.java:1119)
App information
- ID:
com.nextcloud.client - Version:
30340190 - Build flavor:
gplay
Device information
- Brand:
google - Device:
husky - Model:
Pixel 8 Pro - Id:
BP3A.251005.004.B2 - Product:
husky
Firmware
- SDK:
36 - Release:
16 - Incremental:
14331693
Server error logs
Additional information
- Edit: Solved by changing the order while searching for a file
No response
I have the same mistake
Cause of error
Exception in thread "pool-19-thread-1" java.util.ConcurrentModificationException
at java.util.ArrayList.sort(ArrayList.java:1823)
at java.util.Collections.sort(Collections.java:207)
at kotlin.collections.CollectionsKt__MutableCollectionsJVMKt.sortWith(MutableCollectionsJVM.kt:42)
at com.owncloud.android.utils.FileSortOrderByDate.sortLocalFiles(FileSortOrderByDate.kt:51)
at com.owncloud.android.ui.adapter.LocalFileListAdapter.lambda$setSortOrder$6(LocalFileListAdapter.java:392)
at com.owncloud.android.ui.adapter.LocalFileListAdapter.$r8$lambda$WTDJyclhOx9wYl9P9c9Mv0A876o(Unknown Source:0)
at com.owncloud.android.ui.adapter.LocalFileListAdapter$$ExternalSyntheticLambda3.run(D8$$SyntheticClass:0)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1156)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:651)
at java.lang.Thread.run(Thread.java:1119)
App information
- ID:
com.nextcloud.client - Version:
30340190 - Build flavor:
gplay
Device information
- Brand:
samsung - Device:
dm2q - Model:
SM-S916B - Id:
AP3A.240905.015.A2 - Product:
dm2qxxx
As far as I've seen, it goes away if, before changing the order, you type something in the search bar. Afterwards, it works everytime... I may guess this is something related to the default directory of the new nextcloud version? (I don't know nextcloud's code, but from my programming experience, that's mostly what it seems)
If you're looking for a temporary solution, I suggest trying this out and letting me (us) know, thanks!
I'm still getting the same error
I'm also getting the error. It seems to me that searching isn't working and therefore the suggested workaround is not avoiding the issue in my case. Also ordering in general looks to me broken in the current nextcloud android app.