Expose chat read positions and E2EE errors

Add optional chat activity and read-position details to the unread-count endpoint. Return stable E2EE rejection codes for stale timestamps and untrusted signing devices, with tests for both behaviors.
This commit is contained in:
Artemy
2026-11-15 21:26:00 +07:00
parent def724e0ee
commit 31d704712c
9 changed files with 108 additions and 8 deletions
@@ -11,4 +11,9 @@ public interface IMessageReadingService
Task<Result<ChatReadResult, Error>> ReadChatAsync(Guid readerId, Guid chatId,
RecipientType type, IReadOnlyCollection<Guid>? messageIds = null, Guid? upToMessageId = null);
Task<Result<int, Error>> GetUnreadCountAsync(Guid readerId, Guid chatId, RecipientType type);
Task<Result<ChatActivity, Error>> GetChatActivityAsync(Guid readerId, Guid chatId, RecipientType type,
bool includeReadPosition = false);
}
public sealed record ChatActivity(int UnreadCount, DateTime? LastMessageAt,
Guid? LastReadMessageId = null, Guid? FirstUnreadMessageId = null);