Skip to content

fix(file-list): updating recommended files#16807

Merged
alperozturk96 merged 1 commit into
masterfrom
fix/file-list-recommended-files-invalid-index
Apr 8, 2026
Merged

fix(file-list): updating recommended files#16807
alperozturk96 merged 1 commit into
masterfrom
fix/file-list-recommended-files-invalid-index

Conversation

@alperozturk96

@alperozturk96 alperozturk96 commented Apr 7, 2026

Copy link
Copy Markdown
Collaborator

Issue

We’re seeing multiple crash logs like this, but none of them clearly point to the exact root cause. Since the crash involves GridLayoutManager, it suggests that the issue is likely coming from OCFileListAdapter.java.

Looking into the adapter logic, the problem may be related to how recommended files are handled. In particular, the shouldShowHeader() logic could be causing invalid positions in the list, which might lead to this crash.

Exception java.lang.IndexOutOfBoundsException:
  at androidx.recyclerview.widget.RecyclerView$Recycler.validateViewHolderForOffsetPosition (RecyclerView.java:6590)
  at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline (RecyclerView.java:6796)
  at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition (RecyclerView.java:6757)
  at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition (RecyclerView.java:6753)
  at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next (LinearLayoutManager.java:2362)
  at androidx.recyclerview.widget.GridLayoutManager.layoutChunk (GridLayoutManager.java:584)
  at androidx.recyclerview.widget.LinearLayoutManager.fill (LinearLayoutManager.java:1622)
  at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren (LinearLayoutManager.java:687)
  at androidx.recyclerview.widget.GridLayoutManager.onLayoutChildren (GridLayoutManager.java:182)

Changes

To make this more stable, it would be safer to use notifyDataSetChanged() when updating the list, and avoid reassigning the dataset variable.

Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
@github-actions

github-actions Bot commented Apr 7, 2026

Copy link
Copy Markdown

Codacy

SpotBugs

CategoryBaseNew
Bad practice3636
Correctness6969
Dodgy code229229
Experimental11
Internationalization77
Malicious code vulnerability22
Multithreaded correctness3434
Performance4242
Security1616
Total436436

@github-actions

github-actions Bot commented Apr 7, 2026

Copy link
Copy Markdown

APK file: https://github.com/nextcloud/android/actions/runs/24071780996/artifacts/6301777250
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.
qrcode (please click on link to get QR code displayed)

@github-actions

github-actions Bot commented Apr 7, 2026

Copy link
Copy Markdown

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

@alperozturk96 alperozturk96 merged commit 0042993 into master Apr 8, 2026
17 of 21 checks passed
@alperozturk96 alperozturk96 deleted the fix/file-list-recommended-files-invalid-index branch April 8, 2026 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants