Skip to content

IndexOutOfBoundsException in Favorite view having duplicate entries: EmptyRecyclerView #10725

@myxor

Description

@myxor

⚠️ Before posting ⚠️

  • This is a bug, not a question or an enhancement.
  • I've searched for similar issues and didn't find a duplicate.
  • I've written a clear and descriptive title for this issue, not just "Bug" or "Crash".
  • I agree to follow Nextcloud's Code of Conduct.

Steps to reproduce

  1. Open Favorite view in app
  2. Scroll down

Cause of error

Exception in thread "main" java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid view holder adapter positionOCFileListItemViewHolder{845b55b position=16 id=-1, oldPos=-1, pLpos:-1 no parent} com.owncloud.android.ui.EmptyRecyclerView{4c12421 VFED..... .......D 0,0-1080,2134 #7f0a0286 app:id/list_root}, adapter:com.owncloud.android.ui.adapter.OCFileListAdapter@8466ba, layout:androidx.recyclerview.widget.LinearLayoutManager@d88996b, context:com.owncloud.android.ui.activity.FileDisplayActivity@f567254
    at androidx.recyclerview.widget.RecyclerView$Recycler.validateViewHolderForOffsetPosition(RecyclerView.java:6156)
    at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6339)
    at androidx.recyclerview.widget.GapWorker.prefetchPositionWithDeadline(GapWorker.java:288)
    at androidx.recyclerview.widget.GapWorker.flushTaskWithDeadline(GapWorker.java:345)
    at androidx.recyclerview.widget.GapWorker.flushTasksWithDeadline(GapWorker.java:361)
    at androidx.recyclerview.widget.GapWorker.prefetch(GapWorker.java:368)
    at androidx.recyclerview.widget.GapWorker.run(GapWorker.java:399)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:223)
    at android.app.ActivityThread.main(ActivityThread.java:7664)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

App information

  • ID: com.nextcloud.client
  • Version: 30210290
  • Build flavor: generic

Device information

  • Brand: Xiaomi
  • Device: lavender
  • Model: Redmi Note 7
  • Id: RQ3A.211001.001
  • Product: lineage_lavender

Firmware

  • SDK: 30
  • Release: 11
  • Incremental: eng.root.20220718.044033

Expected behaviour

Should not crash

Actual behaviour

Crashes. See above.

Strange thing is that all my Favorite folders or files are been listed multiple (there) times.

Android version

11

Device brand and model

Xiaomi Redmi Note 7

Stock or custom OS?

Custom (explain in "additional information")

Nextcloud android app version

30210290

Nextcloud server version

23

Using a reverse proxy?

Yes

Android logs

No response

Server error logs

No response

Additional information

Lineage OS

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugfeature: filesperformance: misclag, ANR, etc and rarer exceptions/errors that don't have their own labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions