Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hidden files on external storage with dotfiles crash the app #3280

Closed
kescherCode opened this issue Nov 21, 2018 · 4 comments
Closed

Hidden files on external storage with dotfiles crash the app #3280

kescherCode opened this issue Nov 21, 2018 · 4 comments
Labels
needs info Waiting for info from user(s). Issues with this label will auto-stale.

Comments

@kescherCode
Copy link

When enabling hidden files in settings and accessing an external storage (using SFTP) containing dotfiles, the Android app crashes.

Actual behaviour

  • The app crashes

Expected behaviour

  • The app should display a list of files

Steps to reproduce

  1. Have the following list of files and folders in the directory defined as root on an SFTP external storage
Folders:

.apache2
.cache
.config
.local
.logs
.nano
.nginx
.script-credentials
.ssh
.subversion
.znc
------------------------------
Files:

.bash_aliases
.bash_history
.bash_logout
.bashrc
.feral_aliases
.mysql_history
.profile
.selected_editor
.wget-hsts
  1. Enable hidden files in the Nextcloud app settings.

  2. Access the external storage

Environment data

Android version: 8.1.2 or 7.0

Device model: Xiaomi Redmi Note 4 (mido), or also stock Samsung Galaxy A5 2016

Stock or customized system: Customized LineageOS 15.1, Stock "Samsung Experience".

Nextcloud app version: 3.3.2

Nextcloud server version: 14.0.3

Logs

Stacktrace

E/AndroidRuntime( 4641): FATAL EXCEPTION: main
E/AndroidRuntime( 4641): Process: com.nextcloud.client, PID: 4641
E/AndroidRuntime( 4641): java.lang.IllegalArgumentException: Comparison method violates its general contract!
E/AndroidRuntime( 4641): 	at java.util.TimSort.mergeHi(TimSort.java:899)
E/AndroidRuntime( 4641): 	at java.util.TimSort.mergeAt(TimSort.java:516)
E/AndroidRuntime( 4641): 	at java.util.TimSort.mergeCollapse(TimSort.java:441)
E/AndroidRuntime( 4641): 	at java.util.TimSort.sort(TimSort.java:245)
E/AndroidRuntime( 4641): 	at java.util.Arrays.sort(Arrays.java:1498)
E/AndroidRuntime( 4641): 	at java.util.ArrayList.sort(ArrayList.java:1470)
E/AndroidRuntime( 4641): 	at java.util.Collections.sort(Collections.java:201)
E/AndroidRuntime( 4641): 	at com.owncloud.android.utils.FileSortOrderByName.sortCloudFiles(FileSortOrderByName.java:52)
E/AndroidRuntime( 4641): 	at com.owncloud.android.ui.adapter.OCFileListAdapter.swapDirectory(OCFileListAdapter.java:513)
E/AndroidRuntime( 4641): 	at com.owncloud.android.ui.fragment.OCFileListFragment.listDirectory(OCFileListFragment.java:1080)
E/AndroidRuntime( 4641): 	at com.owncloud.android.ui.fragment.OCFileListFragment.onItemClicked(OCFileListFragment.java:809)
E/AndroidRuntime( 4641): 	at com.owncloud.android.ui.adapter.OCFileListAdapter.lambda$onBindViewHolder$0$OCFileListAdapter(OCFileListAdapter.java:276)
E/AndroidRuntime( 4641): 	at com.owncloud.android.ui.adapter.OCFileListAdapter$$Lambda$0.onClick(Unknown Source:4)
E/AndroidRuntime( 4641): 	at android.view.View.performClick(View.java:6294)
E/AndroidRuntime( 4641): 	at android.view.View$PerformClick.run(View.java:24770)
E/AndroidRuntime( 4641): 	at android.os.Handler.handleCallback(Handler.java:790)
E/AndroidRuntime( 4641): 	at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 4641): 	at android.os.Looper.loop(Looper.java:164)
E/AndroidRuntime( 4641): 	at android.app.ActivityThread.main(ActivityThread.java:6494)
E/AndroidRuntime( 4641): 	at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 4641): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:440)
E/AndroidRuntime( 4641): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

Web server error log

Error log stays empty when reproducing the issue (and five minutes afterwards).

Nextcloud log (data/nextcloud.log)

Error log stays empty when reproducing the issue (and five minutes afterwards).

@nextcloud-android-bot
Copy link
Collaborator

GitMate.io thinks possibly related issues are #2529 (App crash), #31 (Removing file crashes app.), #41 (Crash on sharing to app), #2515 (Crash at files loading), and #2574 (crash on file delete).

@AndyScherzinger
Copy link
Member

Hi @filthycoding, thanks a lot for the report. We merged a contribution for fixing the sorting implementation (for the next feature release). Could you give the Dev build a try -> https://f-droid.org/de/packages/com.nextcloud.android.beta/ to check if this version solves your problem?

@AndyScherzinger AndyScherzinger added the needs info Waiting for info from user(s). Issues with this label will auto-stale. label Nov 21, 2018
@kescherCode
Copy link
Author

Hi @AndyScherzinger, the latest dev build on F-Droid actually fixes the issue.

@AndyScherzinger
Copy link
Member

I created another test case, see #3281 to have this covered in via continuous integration with every build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs info Waiting for info from user(s). Issues with this label will auto-stale.
Projects
None yet
Development

No branches or pull requests

3 participants