fix(operations): preserve UTC markers in response timestamps
This commit is contained in:
@@ -60,16 +60,17 @@ public sealed record OperationDto(
|
||||
bool CanCancel,
|
||||
bool CanRetry)
|
||||
{
|
||||
// SQLite drops DateTime.Kind; these fields retain their stored UTC ticks.
|
||||
public static OperationDto From(UserOperation operation) => new(
|
||||
operation.Id,
|
||||
operation.TaskType,
|
||||
operation.Status,
|
||||
operation.SubjectType,
|
||||
operation.CreatedAtUtc,
|
||||
operation.StartedAtUtc,
|
||||
operation.CompletedAtUtc,
|
||||
operation.DeadlineAtUtc,
|
||||
operation.CancellationRequestedAtUtc,
|
||||
DateTime.SpecifyKind(operation.CreatedAtUtc, DateTimeKind.Utc),
|
||||
operation.StartedAtUtc is { } started ? DateTime.SpecifyKind(started, DateTimeKind.Utc) : null,
|
||||
operation.CompletedAtUtc is { } completed ? DateTime.SpecifyKind(completed, DateTimeKind.Utc) : null,
|
||||
operation.DeadlineAtUtc is { } deadline ? DateTime.SpecifyKind(deadline, DateTimeKind.Utc) : null,
|
||||
operation.CancellationRequestedAtUtc is { } cancellation ? DateTime.SpecifyKind(cancellation, DateTimeKind.Utc) : null,
|
||||
operation.ProgressStage,
|
||||
operation.ProgressPercent,
|
||||
operation.FailureCategory,
|
||||
@@ -116,8 +117,8 @@ public sealed class NotificationsController(UserNotificationStore notifications)
|
||||
notification.Title,
|
||||
notification.Message,
|
||||
notification.LinkPath,
|
||||
notification.CreatedAtUtc,
|
||||
notification.ReadAtUtc);
|
||||
DateTime.SpecifyKind(notification.CreatedAtUtc, DateTimeKind.Utc),
|
||||
notification.ReadAtUtc is { } read ? DateTime.SpecifyKind(read, DateTimeKind.Utc) : null);
|
||||
}
|
||||
|
||||
public sealed record NotificationDto(
|
||||
|
||||
Reference in New Issue
Block a user