Skip to content

fix(upload-list-adapter): invalid view holder adapter position#16604

Open
alperozturk96 wants to merge 6 commits intomasterfrom
fix/upload-list-adapter-recycler-view
Open

fix(upload-list-adapter): invalid view holder adapter position#16604
alperozturk96 wants to merge 6 commits intomasterfrom
fix/upload-list-adapter-recycler-view

Conversation

@alperozturk96
Copy link
Collaborator

@alperozturk96 alperozturk96 commented Feb 27, 2026

Issue

  1. UploadListAdapter using ThreadPoolExecutor, UploadGroup, GroupConfig, UploadGroupLoadRunnable to determine items of the list via complex and error prone way.
  2. Refreshing list right away after async all causing sometimes

Exception in thread "main" java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid view holder adapter positionItemViewHolder{f9f6c09 position=7 id=-1, oldPos=-1, pLpos:-1 scrap [attachedScrap] tmpDetached no parent} com.owncloud.android.ui.EmptyRecyclerView{1c1ee0e VFED..... ......I. 0,0-1440,2596 #102000a android:id/list}, adapter:com.owncloud.android.ui.adapter.UploadListAdapter@ca641dc, layout:androidx.recyclerview.widget.GridLayoutManager@2eed02f, context:com.owncloud.android.ui.activity.UploadListActivity@8a5eb50

Changes

Just Section record used to get items for adapter.
Waits results of async calls before refresh adapter.
Use more suitable title for FINISHED type. Completed instead of Uploaded

Screenshot 2026-02-27 at 15 03 22

Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
… call

Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
@alperozturk96 alperozturk96 added the performance 🚀 Performance improvement opportunities (non-crash related) label Feb 27, 2026
@github-actions
Copy link

Codacy

SpotBugs

CategoryBaseNew
Bad practice4242
Correctness7573
Dodgy code253252
Experimental11
Internationalization77
Malicious code vulnerability22
Multithreaded correctness3434
Performance4343
Security1818
Total475472

@github-actions
Copy link

blue-Light-Screenshot test failed, but no output was generated. Maybe a preliminary stage failed.

@github-actions
Copy link

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/16604.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review performance 🚀 Performance improvement opportunities (non-crash related)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quickly deleting lots of failed uploads triggers an out of bounds exception

1 participant