Harden notifications: bump MailKit, bound webhook body, share truncation, skip soft-deleted members
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user