namespace DodoSSH.Api.Features.Sync;

/// <summary>Source-generated log messages for sync.</summary>
/// <remarks>
/// Deliberately records ids, versions and counts only. Payloads are ciphertext, but their sizes and
/// access patterns still leak, and there is no diagnostic value in them.
/// </remarks>
internal static partial class SyncLog
{
    [LoggerMessage(
        EventId = 2001,
        Level = LogLevel.Information,
        Message = "Push conflict on item {EntityId}: client expected version {ExpectedVersion}, "
            + "server holds {ServerVersion}.")]
    internal static partial void PushConflict(
        ILogger logger,
        Guid entityId,
        int? expectedVersion,
        int? serverVersion);

    [LoggerMessage(
        EventId = 2002,
        Level = LogLevel.Information,
        Message = "Applied {AppliedCount} of {OperationCount} operation(s) to vault {VaultId}.")]
    internal static partial void PushApplied(
        ILogger logger,
        int appliedCount,
        int operationCount,
        Guid vaultId);
}
