Skip to content

feat(recovery): crash recovery and sync resumption (#39)#51

Merged
jaybarden1 merged 6 commits into
mainfrom
feature/39-crash-recovery-sync-resumption
May 28, 2026
Merged

feat(recovery): crash recovery and sync resumption (#39)#51
jaybarden1 merged 6 commits into
mainfrom
feature/39-crash-recovery-sync-resumption

Conversation

@jaybarden1

Copy link
Copy Markdown
Contributor

Summary

  • RR-01: Detect interrupted syncs on next launch — SyncRepository.GetInterruptedJobsAsync finds jobs with Status == "Running" that survived a crash/restart; WorkspaceViewModel.LoadPersistedAccountsAsync calls ISyncRecoveryService.DetectAsync and sets HasInterruptedSyncs
  • RR-02: Resume from interruption point — SyncRecoveryService checks DriveStateEntity.DeltaLink; non-empty means delta token was preserved and incremental sync can continue; CanResume flag surfaced via InterruptedSyncInfo
  • RR-03: User-facing message — InterruptedSyncInfo.Message provides a non-technical explanation ("Sync resumed from last checkpoint." or "Sync interrupted. No checkpoint found — a full sync will run on next attempt.")
  • Implicit conversions on Result<T,E>: Added TResult → Result and TError → Result operators; cleaned all verbose new Ok<T,E>(v) / new Fail<T,E>(e) return sites across repositories, services, and Graph layer

Test plan

  • dotnet build — 0 errors, 0 warnings
  • Unit tests — 199 passed, 0 failed (includes 8 new GivenASyncRecoveryService tests + 2 new WorkspaceViewModel recovery tests)
  • Integration tests — 31 passed, 0 failed (includes 8 new GivenASyncRepositoryInterruptedJobs tests)
  • FunctionalParadigm tests — 25 passed, 0 failed

Closes #39

🤖 Generated with Claude Code

jaybarden1 and others added 5 commits May 27, 2026 13:32
Merge GetFirstFolderPageAsync/GetNextFolderPageAsync into single
GetFolderPageAsync(string? nextLink), collapse two GetFoldersFromPagesAsync
overloads into one nullable-accumulator method, inline GetDriveFoldersAsync,
drop Children() helper, and add GraphClient type alias.

Codify the three emerging patterns in c-sharp-code-style.md (using alias,
nullable accumulator over overload pair, inline single-use wrapper) and
replace the Getting root folders prose in onedrive-graph.md with concrete
code examples from the refactored GraphService.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Tests reference ISyncRepository.GetInterruptedJobsAsync/ResetInterruptedJobsAsync,
ISyncRecoveryService, InterruptedSyncInfo, and WorkspaceViewModel recovery props —
none of which exist yet.

Compile errors: 6

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add ISyncRecoveryService / SyncRecoveryService to detect interrupted
  syncs (Status=="Running" jobs surviving restart) and report whether
  delta-token-based resumption is possible
- Add InterruptedSyncInfo record (AccountId, AccountName, CanResume, Message)
- Extend ISyncRepository with GetInterruptedJobsAsync and
  ResetInterruptedJobsAsync; implement in SyncRepository
- Expose HasInterruptedSyncs on WorkspaceViewModel; detect on startup
  via LoadPersistedAccountsAsync
- Register ISyncRecoveryService as Transient in App.axaml.cs
- Add implicit conversion operators to Result<TResult,TError> so return
  sites can use plain values; clean up all verbose Ok/Fail wrapping
  across repositories, services, and Graph layer
- Add integration tests for interrupted-job repository methods (8 tests)
- Add unit tests for SyncRecoveryService (8 tests)

Closes #39

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jaybarden1 jaybarden1 requested a review from a team May 28, 2026 12:31
@jaybarden1 jaybarden1 enabled auto-merge (squash) May 28, 2026 12:34
@github-actions

Copy link
Copy Markdown

Test results

0 tests  ±0   0 ✅ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
0 files   ±0   0 ❌ ±0 

Results for commit 27c6c5c. ± Comparison against base commit f182e8a.

@jbarden jbarden left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed and updated locally before PR

@jaybarden1 jaybarden1 merged commit e5e503b into main May 28, 2026
5 of 6 checks passed
@jaybarden1 jaybarden1 deleted the feature/39-crash-recovery-sync-resumption branch May 28, 2026 12:36
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.

refactor(persistence): PersistenceError lives in Onboarding namespace — inverted dependency

2 participants