Unified search shows a file twice when a provider entry has both fileId and path
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
Direzione di ricerca
Inizia in iOSClient/Main/Collection Common/NCCollectionViewCommon+Search.swift, nel ramo default di getSearchResultMetadatas descritto nella issue. Segui la gestione delle voci con sia fileId che filePath, poi verifica la copertura nei test di ricerca vicini. Il lavoro è completato quando un file noto localmente, restituito con entrambi gli attributi, compare una volta nella sezione del provider.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
How to use GitHub
- Please use the 👍 reaction to show that you are affected by the same issue.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Steps to reproduce
- Have a unified search provider, other than
files, whose entries carry both afileIdand apathattribute. Seen with paperless_unified_search 1.3.0. - Open a file in the app, or the folder holding it, so the file is in the app's local database.
- Search for a term that returns that file from the provider.
Expected behaviour
The file appears once in the provider's section.
Actual behaviour
The same file appears twice in the provider's section. Both rows show the same folder.
Logs
The cause looks like the default: branch of getSearchResultMetadatas in iOSClient/Main/Collection Common/NCCollectionViewCommon+Search.swift (tag 35.2.2; the same code is on master):
if let fileId = entry.fileId,
let metadata = database.getMetadataFromFileId(String(fileId), account: session.account) {
metadata.section = provider.name
metadatas.append(metadata) // first append, no continue
}
if let filePath = entry.filePath,
let metadata = await loadMetadata(session: session,
provider: provider,
filePath: filePath) {
metadatas.append(metadata) // second append of the same file
continue
}
The first if has no continue, so an entry whose file is already known locally is appended by ID and then again by path. A continue after the first append looks like the fix.
What I checked:
- The server sends one entry. The provider's response for the term held
entriesof length 1, with{"fileId": "...", "path": "/.../file.pdf"}inattributes. - The file exists once in the server's file cache.
- Removing the
fileIdattribute on the server leaves one entry with onlypath, which should take only the second branch. I have not yet confirmed that on the device.
I found this by reading the source, with help from Claude Code. I did not build the app or run it under a debugger.
Reasoning or why should it be changed/implemented?
Any provider that returns real files can show each previously opened file twice, which reads as a duplicate on the server.
Environment data
iOS version: not recorded
Nextcloud iOS app version: 35.2.2
Server operating system: Debian 13 (Nextcloud Docker image)
Web server: Apache 2.4
Database: PostgreSQL 18
PHP version: 8.5.12
Nextcloud version: 35.0.2
- Lingua principale
- Swift
- Stelle
- 2.5k
- Fork
- 1k
- Merge medio
- 2g 1h
- PR unite (30g)
- 21
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di nextcloud/ios
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Modify action only shown in context menuForse già presa @mpivchev l’ha presa 15 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
nextcloud/ios#4332 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
i18n: Change text stringAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di nextcloud/ios
Issue simili
-
area: agents follow-up
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
manaflow-ai/cmux#37234 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
bug product / functions
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 61/100
JWhite212/SignalLadder#215 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100