Skip to content

Conversation

@ZetaTom
Copy link
Collaborator

@ZetaTom ZetaTom commented Jan 27, 2026

This change addresses an issue where files would be duplicated in the Shared tab under certain conditions.

Steps to reproduce

  1. Set up Nextcloud user account and create multiple shares
  2. Checkout branch of pull request
  3. Apply the diff below (Diff for testing)
    • not strictly required; bypasses early exit
  4. Build Nextcloud app and sign in
  5. Open Shared tab
  6. Check if there are any duplicate entries present
    • compare to master branch
Diff for testing

diff --git a/app/src/main/java/com/owncloud/android/ui/adapter/OCShareToOCFileConverter.kt b/app/src/main/java/com/owncloud/android/ui/adapter/OCShareToOCFileConverter.kt
index fd17de1605..f56fffd58f 100644
--- a/app/src/main/java/com/owncloud/android/ui/adapter/OCShareToOCFileConverter.kt
+++ b/app/src/main/java/com/owncloud/android/ui/adapter/OCShareToOCFileConverter.kt
@@ -59,9 +59,7 @@ object OCShareToOCFileConverter {
             return@withContext emptyList()
         }
 
-        val newShares = shares.filter { share ->
-            cachedFiles.none { file -> file.decryptedRemotePath == share.path }
-        }
+        val newShares = shares
 
         if (newShares.isEmpty()) {
             return@withContext cachedFiles

Screenshots

Current Version on master This Pull Request
master pr

  • Tests written, or not not needed

- only filename based sorting options available
- OCFiles are shallow copies of OCShare and lack data
- hardcoded FileSortOrder.SORT_A_TO_Z for now

Signed-off-by: ZetaTom <[email protected]>
- deduplicate (cachedFiles + newFiles)

Signed-off-by: ZetaTom <[email protected]>
@ZetaTom ZetaTom self-assigned this Jan 27, 2026
@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/16382.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.

@github-actions
Copy link

Codacy

SpotBugs

CategoryBaseNew
Bad practice4343
Correctness7474
Dodgy code260260
Experimental11
Internationalization77
Malicious code vulnerability33
Multithreaded correctness3434
Performance4343
Security1818
Total483483

@ZetaTom ZetaTom changed the title fix(shared-search): remove duplicate entries fix(shared search): remove duplicate entries Jan 27, 2026
@alperozturk96
Copy link
Collaborator

/backport to stable-3.35

@alperozturk96 alperozturk96 merged commit 9b2f8bd into master Jan 28, 2026
17 of 26 checks passed
@alperozturk96 alperozturk96 deleted the fix/shared-tab-duplicate-entries branch January 28, 2026 07:53
@alperozturk96 alperozturk96 added this to the Nextcloud App 3.35.3 milestone Jan 28, 2026
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.

4 participants