Skip to content

fix(storage): ignore duplicate large-file candidates - #42

Merged
harry0703 merged 1 commit into
harry0703:mainfrom
rorschachwhy:fix/macos-duplicate-large-file-candidates
Sep 3, 2026
Merged

harry0703 merged 1 commit into
harry0703:mainfrom
rorschachwhy:fix/macos-duplicate-large-file-candidates

Conversation

@rorschachwhy

Copy link
Copy Markdown
Contributor

Summary

  • make advisory native large-file candidate ingestion idempotent when a filesystem index repeats a path
  • preserve strict duplicate rejection for authoritative traversal streams
  • avoid double-counting progress, allocated/logical bytes, and file totals

Problem

On macOS, a full-disk large-file scan can fail while consuming Spotlight results with:

failed to consume the candidate stream: the in-memory index received a duplicate large-file record

Spotlight is an advisory candidate source and can repeat a path. A repeated, already-validated candidate should not abort the entire scan.

Safety

Live scope, protection policy, filesystem, link-type, and size validation still runs before insertion. Only the advisory candidate insertion is idempotent; the existing strict duplicate checks for authoritative traversal/index records remain unchanged.

Validation

  • pnpm check
  • cargo test --manifest-path src-tauri/Cargo.toml -p mangodisk-core (495 passed, 0 failed)
  • deterministic regression test covering duplicate native candidates and aggregate accounting
  • real macOS root-volume Spotlight fast-path scan completed successfully
  • Windows was not run locally

@harry0703

Copy link
Copy Markdown
Owner

Thank you for identifying and fixing this issue. The distinction between advisory candidate ingestion and authoritative index validation is clear and well scoped.

I also verified the change on Windows ARM64: the duplicate-candidate regression test passed, the full Core suite passed with 523 tests and no failures, and pnpm check completed successfully. This improves scan reliability and keeps file-count and size accounting accurate across platforms.

Thanks again for the thoughtful contribution!

@harry0703
harry0703 merged commit cb20d9d into harry0703:main Sep 3, 2026
@harry0703

Copy link
Copy Markdown
Owner

Your fix is now included in 1.0.9. Repeated paths from Spotlight no longer interrupt large-file scans or cause files and sizes to be counted twice.

Thanks for the contribution and the regression test! I've also credited you in the release notes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants