nextcloud / nextcloud/android

file upload chooser select all: Two different ViewHolders have the same stable ID

Open
#17,042 0 comments 0 reactions 0 assignees View on GitHub
0. Needs triage bug
Dominant language
Kotlin
Stars
5.6k
Forks
2k
Avg merge
2d 18h
Merged PRs (30d)
92

Description

### ⚠️ Before posting ⚠️

- [x] This is a **bug**, not a question or an enhancement.
- [x] I've [searched for similar issues](https://github.com/nextcloud/android/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](https://nextcloud.com/contribute/code-of-conduct/).

### Steps to reproduce

hit select all when choosing a file to upload. also other parts of the file selection weren't working. and maybe an off by one error?

### Expected behaviour

let me choose a file to upload. show visually which items are currently selected.

### Actual behaviour

### Cause of error
```java
Exception in thread "main" java.lang.IllegalStateException: Two different ViewHolders have the same stable ID. Stable IDs in your adapter MUST BE unique and SHOULD NOT change.
ViewHolder 1:LocalFileListFooterViewHolder{7be8bb8 position=45 id=-1, oldPos=-1, pLpos:-1 not recyclable(1)}
View Holder 2:LocalFileListItemViewHolder{8992370 position=44 id=-1, oldPos=-1, pLpos:-1} com.owncloud.android.ui.EmptyRecyclerView{303bd91 VFED..... ......ID 0,0-1080,1533 #7f0a02ec app:id/list_root}, adapter:com.owncloud.android.ui.adapter.LocalFileListAdapter@445c091, layout:androidx.recyclerview.widget.LinearLayoutManager@b8014f6, context:com.owncloud.android.ui.activity.UploadFilesActivity@a100ff1
at androidx.recyclerview.widget.RecyclerView.handleMissingPreInfoForChangeError(RecyclerView.java:4778)
at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep3(RecyclerView.java:4702)
at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:4367)
at androidx.recyclerview.widget.RecyclerView.consumePendingUpdateOperations(RecyclerView.java:2095)
at androidx.recyclerview.widget.RecyclerView$1.run(RecyclerView.java:468)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1647)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1656)
at android.view.Choreographer.doCallbacks(Choreographer.java:1252)
at android.view.Choreographer.doFrame(Choreographer.java:1177)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1630)
at android.os.Handler.handleCallback(Handler.java:1095)
at android.os.Handler.dispatchMessageImpl(Handler.java:135)
at android.os.Handler.dispatchMessage(Handler.java:125)
at android.os.Looper.loopOnce(Looper.java:269)
at android.os.Looper.loop(Looper.java:367)
at android.app.ActivityThread.main(ActivityThread.java:9333)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:566)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:929)

```

### App information
* ID: `com.nextcloud.client`
* Version: `330010090`
* Build flavor: `generic`

### Device information
* Brand: `google`
* Device: `panther`
* Model: `Pixel 7`
* Id: `CP1A.260405.005`
* Product: `panther`

### Firmware
* SDK: `36`
* Release: `16`
* Incremental: `15001963`

### Android version

* SDK: `36` * Release: `16` * Incremental: `15001963`

### Device brand and model

* Model: `Pixel 7`

### Stock or custom OS?

Stock

### Nextcloud android app version

33.1.0

### Nextcloud server version

31.0.4

### Using a reverse proxy?

I don't know

### Android logs

_No response_

### Server error logs

```bash

```

### Additional information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.