# ISyncService

- File ID: file:l3weg3:isyncservice-cs
- Path: NexusReader.UI.Shared/Services/ISyncService.cs
- Role: service
- Layer: application

## Purpose

Defines a shared synchronization service contract for reporting and receiving ebook reading progress within UI layers.

## Key Details

A lightweight interface in the shared UI layer defining async lifecycle (initialize/dispose), progress reporting via UpdateProgressAsync, and an OnProgressReceived event; uses FluentResults.Result for result semantics.

## Symbols

- ISyncService: Defines a shared synchronization service contract for reporting and receiving ebook reading progress within UI layers.
- InitializeAsync(): Initializes the sync service (e.g., prepare connections or state) and returns success/failure as a FluentResults.Result.
- UpdateProgressAsync(): Reports progress/state for a given ebook and page, returning a Result indicating success or failure.
- OnProgressReceived(): Event invoked when progress is received; subscribers are called with a page id and timestamp.
- DisposeAsync(): Asynchronously disposes or tears down the sync service resources.
- ISyncService: Contract for a synchronization service that initializes, reports progress, exposes progress events, and can be disposed asynchronously.

## Dependencies

- No resolved dependencies.

## Calls

- No resolved calls.

## Coverage

- Symbols: 6
- Executable symbols: 4
- Executable symbols with control flow: 4
- Grounded edges: 6
- Unresolved references: 0
- Control-flow fragments: 4
- Unresolved jumps: 0
- Unsupported constructs: 0
- Control-flow coverage: 100%
- Required diagrams: 2
- Generated diagrams: 2

## Control Flow Fragments

- InitializeAsync: 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs
- UpdateProgressAsync: 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs
- OnProgressReceived: 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs
- DisposeAsync: 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs

## Diagrams

### ISyncService Neighborhood

```mermaid
flowchart LR
    class_1xcfdo4_isyncservice("ISyncService")
    file_l3weg3_isyncservice_cs("ISyncService")
    method_10p42fw_initializeasync[["InitializeAsync()"]]
    method_163m6av_disposeasync[["DisposeAsync()"]]
    method_1op2ws5_updateprogressasync[["UpdateProgressAsync()"]]
    method_pqi00v_onprogressreceived[["OnProgressReceived()"]]
    type_yxmwa5_isyncservice[/"ISyncService"/]
```

### ISyncService Execution Overview

```mermaid
flowchart TD
    class_1xcfdo4_isyncservice("ISyncService")
    method_10p42fw_initializeasync[["InitializeAsync()"]]
    method_163m6av_disposeasync[["DisposeAsync()"]]
    method_1op2ws5_updateprogressasync[["UpdateProgressAsync()"]]
    method_pqi00v_onprogressreceived[["OnProgressReceived()"]]
    class_1xcfdo4_isyncservice -->|contains| method_10p42fw_initializeasync
    class_1xcfdo4_isyncservice -->|contains| method_163m6av_disposeasync
    class_1xcfdo4_isyncservice -->|contains| method_1op2ws5_updateprogressasync
    class_1xcfdo4_isyncservice -->|contains| method_pqi00v_onprogressreceived
```

## Diagram Validation

- Status: pass
