Repository navigation
Conversation
Like Everything's duplicate finder: "dupes:" lists the files here and below that have an identical twin, compared by size, then the first 64 KB, then every byte, each set of twins together and the biggest first. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
[Medium impact] The changes affect folder search within Folio's file manager. The PR is not safe to merge while read failures can label different files as duplicates and the trash search misses matches across drives. Findings
SummaryAdds
Reviews (2) · Last reviewed commit: "Merge incremental-search, and make a dup..." · Reviewed by Greptile |
| const QByteArray chunk = file.read(left < 0 ? 1 << 20 : qMin<qint64>(left, 1 << 20)); | ||
| if (chunk.isEmpty()) | ||
| break; | ||
| hash.addData(chunk); | ||
| if (left > 0) | ||
| left -= chunk.size(); | ||
| } | ||
| return hash.result(); |
There was a problem hiding this comment.
Read failures look like duplicates.
hashOf treats a failed read like the end of the file and returns a valid hash of whatever it read. If equal-size files fail before returning any bytes, they all receive the hash of empty content and appear as duplicates despite having different contents. The same problem occurs when reads fail after a shared prefix. Reject failed reads instead of returning their partial hash.
| if (wanted.dupes) { | ||
| entries = duplicatesAmong(entries, limit, stop); |
There was a problem hiding this comment.
Trash misses duplicates across drives. The new duplicate check runs inside
search, but listTrash calls search separately for each drive. A file in the home trash and its identical twin in another drive's trash are therefore both omitted. Each call also restarts group, so unrelated sets from different drives can mix together when sorted. Gather candidates from all trash folders before finding and numbering the duplicate sets.
| const auto split = [&](const QVector<int> &rows, qint64 bytes) { | ||
| QHash<QByteArray, QVector<int>> sets; | ||
| for (int row : rows) { | ||
| const QByteArray hash = hashOf(files[row].path, bytes); |
There was a problem hiding this comment.
Canceled searches keep reading files.
split never checks stop between files, and hashOf never checks it between chunks. Leaving a duplicate search during a full-file comparison still reads every file in that set, which can take a long time for disk images or videos. These jobs share the eight workers used to list folders, so abandoned searches waste disk work and can delay later listings. Check stop between files and between read chunks.
Typing on ("beac" to "beach") or adding an ext: keeps the matches that
still fit instead of walking the folder again, when the last search wasn't
cut short by the limit. Widening, or a change of folder, looks again.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
| setLoading(false); | ||
| emit loaded(); | ||
| return; |
There was a problem hiding this comment.
Folder counts stay blank. Narrowing a completed search returns here without restarting
countFolders. If the user types while the previous folder counts are still running, reload advances m_generation and those counts are discarded. The kept folders still have itemCount == -1, so their counts stay blank until another search or refresh.
Call countFolders(generation) before returning so unfinished counts restart for the kept rows.
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
Adds
dupes:to the search (/), after Everything's duplicate finder. It lists the files here and below that have an identical twin, each set together and the biggest first. Files are compared by size, then their first 64 KB, then every byte (SHA-1). Folders, symlinks and empty files are skipped. The rest of the query still narrows what's compared (dupes: ext:jpg).Includes a test and a README line.
bin/testpasses.🤖 Generated with Claude Code