Skip to content

feat(onedrive-sync): include unsynced classified files in search, tags and duplicates#741

Open
jbarden wants to merge 3 commits into
mainfrom
feature/search-include-unsynced-files
Open

feat(onedrive-sync): include unsynced classified files in search, tags and duplicates#741
jbarden wants to merge 3 commits into
mainfrom
feature/search-include-unsynced-files

Conversation

@jbarden

@jbarden jbarden commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Search, tag filtering, and duplicate detection in the OneDrive Sync Client previously only covered files that had already been synced. Classified files on disk (rows in FileDetail/FileClassifications produced by the scraper) under the account's local sync root were invisible until a sync linked them. This change includes those unsynced files:

  • GetDistinctTagNamesAsync returns categories of classified files under the account's LocalSyncPath, in addition to synced-item classifications.
  • SearchAsync unions the synced-item query with an unsynced FileDetail query (same name/size/tag filters); unsynced results carry IsSynced = false and a FileDetailId, with LocalPath built from DirectoryName + FileName.
  • Duplicate detection groups by (size, file name) across synced items and unsynced file details, so an unsynced copy of a synced file now surfaces.
  • Deleting an unsynced result removes the disk file, its classification links, clears any SyncedItem.FileDetailId references, and deletes the FileDetail row (new DeleteFileDetailAsync). Synced deletes are unchanged.
  • Accounts with no row or a blank LocalSyncPath behave exactly as before.
  • ApplicationVersion bumped 0.32.2 → 0.33.0 (feature rule).

Repository unit tests moved from the EF InMemory provider to SQLite: the account-root lookup materialises AccountEntity, whose complex properties the InMemory provider cannot shape (KeyNotFoundException on AccountProfile.DisplayName).

Type of change

  • Feature
  • Bug fix
  • Refactor
  • CI/CD
  • Documentation
  • Maintenance

Related issues / links

How was this tested?

  • Unit tests added/updated
  • Manual validation
  • Not applicable

12 new tests (failing-first commit c81f552): unsynced tags in/out of root, unsynced search inclusion/exclusion, name/tag filters on unsynced files, cross-set duplicates, no-root fallback, DeleteFileDetailAsync cascade + reference clearing, viewmodel delete routing. Full suite green: OneDrive client 2169/2169 unit, 27/27 integration; all other projects passing, 0 failures.

Impacted areas

  • apps/desktop/AStar.Dev.OneDrive.Sync.Client (repository, search viewmodel, appsettings)
  • packages/AStar.Dev.Infrastructure.AppDb (SyncedItemSearchResult record + factory)

TDD Checklist (required)

  • Builds locally
  • Tests pass (dotnet test)
  • No new analyzer warnings
  • Public API changes reviewed
  • Documentation updated (if applicable)
  • Not applicable

How to run tests locally

# Restore and run tests
dotnet restore AStar.Dev.slnx
dotnet test --verbosity normal

Notes for reviewers

  • Ensure CI passed for all OS runners where configured.
  • Unsynced scoping is a StartsWith prefix match on DirectoryName vs LocalSyncPath — root /data would also match /data-backup. Flag if a separator-aware boundary check is preferred.
  • Unsynced results have Id = 0 and empty remote fields; UI distinguishes via IsSynced.

🤖 Generated with Claude Code

jbarden and others added 3 commits July 12, 2026 10:37
…, duplicates

Unsynced classified files under the account local sync root must appear
in search results, tag lists, and duplicate detection. Adds IsSynced +
FileDetailId to SyncedItemSearchResult and DeleteFileDetailAsync stub so
the red tests compile.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…s and duplicates

Search, tag list, and duplicate detection now cover FileDetail rows
under the account's local sync root that no synced item references.
Unsynced results carry IsSynced=false and FileDetailId; deleting one
removes the disk file, classification links, and the FileDetail row.
Account scoping uses the LocalSyncPath prefix; accounts without a
configured root behave exactly as before.

Repository unit tests move from the EF InMemory provider to SQLite:
the account-root lookup materialises AccountEntity, whose complex
properties the InMemory provider cannot shape.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jbarden jbarden requested a review from a team July 12, 2026 09:56
@github-actions

Copy link
Copy Markdown

Test results

3 201 tests  +13   3 200 ✅ +13   2m 25s ⏱️ +8s
   13 suites ± 0       1 💤 ± 0 
   13 files   ± 0       0 ❌ ± 0 

Results for commit 1de49bf. ± Comparison against base commit 2d05dc8.

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