🐛 Fix message attachment did not marked

This commit is contained in:
2025-05-18 12:53:32 +08:00
parent b40282e43a
commit 4e794ceb9b
3 changed files with 11 additions and 2 deletions

View File

@ -10,10 +10,12 @@ public class MessageReadReceiptFlushHandler(IServiceProvider serviceProvider) :
{
public async Task FlushAsync(IReadOnlyList<MessageReadReceipt> items)
{
var distinctItems = items.DistinctBy(x => new { x.MessageId, x.SenderId }).ToList();
using var scope = serviceProvider.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<AppDatabase>();
await db.BulkInsertAsync(items);
await db.BulkInsertAsync(distinctItems);
}
}