SyncClient

Classes > Sync > SyncClient

Represents a client tracked by the server for tombstone retention (_sync_clients). Maps to spec Section 13.3.

public sealed record SyncClient : IEquatable<SyncClient>

Example

// Register a new sync client
var client = new SyncClient(
    OriginId: Guid.NewGuid().ToString(),
    LastSyncVersion: 0,
    LastSyncTimestamp: DateTime.UtcNow.ToString("o"),
    CreatedAt: DateTime.UtcNow.ToString("o")
);

// Store in repository
await syncClientRepository.UpsertAsync(client);

Constructors

SyncClient

public SyncClient(string OriginId, long LastSyncVersion, string LastSyncTimestamp, string CreatedAt)

Represents a client tracked by the server for tombstone retention (_sync_clients). Maps to spec Section 13.3.

Parameter Type Description
OriginId String UUID of the client replica.
LastSyncVersion Int64 Last version this client has synced to.
LastSyncTimestamp String ISO 8601 UTC timestamp of last sync.
CreatedAt String ISO 8601 UTC timestamp when client was first registered.

Properties

OriginId

public string OriginId { get; init; }

UUID of the client replica.

LastSyncVersion

public long LastSyncVersion { get; init; }

Last version this client has synced to.

LastSyncTimestamp

public string LastSyncTimestamp { get; init; }

ISO 8601 UTC timestamp of last sync.

CreatedAt

public string CreatedAt { get; init; }

ISO 8601 UTC timestamp when client was first registered.