Harden notifications: bump MailKit, bound webhook body, share truncation, skip soft-deleted members

This commit is contained in:
Chris Chen
2026-06-23 19:29:23 -07:00
parent fd71f5a107
commit 5a915ebdd1
6 changed files with 44 additions and 8 deletions
@@ -31,8 +31,12 @@ public sealed class LineNotificationService : ILineNotificationService
var failures = new List<NotificationFailure>();
var sentCount = 0;
var liveMemberIds = await _db.Members
.Where(m => memberIds.Contains(m.Id))
.Select(m => m.Id)
.ToListAsync(ct);
var bindings = await _db.MemberChannelBindings
.Where(b => b.Channel == Channel && memberIds.Contains(b.MemberId))
.Where(b => b.Channel == Channel && liveMemberIds.Contains(b.MemberId))
.ToListAsync(ct);
foreach (var binding in bindings)
{
@@ -146,7 +150,7 @@ public sealed class LineNotificationService : ILineNotificationService
TargetExternalId = externalId,
MemberId = memberId,
MessagingGroupId = groupId,
Body = body,
Body = NotificationLogText.Truncate(body),
Status = result.Success ? NotificationStatuses.Sent : NotificationStatuses.Failed,
Error = result.Error,
SentByUserId = sentBy,