Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Notification Service #2187

Merged
merged 1 commit into from
Aug 16, 2024
Merged

Fix Notification Service #2187

merged 1 commit into from
Aug 16, 2024

Conversation

Fosol
Copy link
Collaborator

@Fosol Fosol commented Aug 16, 2024

Users should not receive duplicate notifications.

@Fosol Fosol added the bug Something isn't working label Aug 16, 2024
@Fosol Fosol self-assigned this Aug 16, 2024
@@ -385,7 +385,8 @@ export const ViewContent: React.FC<IViewContentProps> = ({ setActiveContent, act
isAV &&
!content?.source?.disableTranscribe &&
!content.isApproved &&
!isTranscriptRequestor
!isTranscriptRequestor &&
!!content?.fileReferences.length
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't allow asking for a transcript if there is no file.

@@ -411,7 +407,8 @@ private async Task ResetAlertAsync(API.Areas.Services.Models.Content.ContentMode
subscribers.AddRange(content.UserNotifications.Where(cun => cun.User != null && cun.IsSubscribed && cun.User.AccountType != UserAccountType.Distribution)
.Select(cun => new API.Areas.Services.Models.Notification.UserModel(cun.User!)));

return subscribers;
// Remove duplicate subscribers. This can occur if a user is both subscribed to the content and the notification.
return subscribers.GroupBy(s => s.Id).Select(s => s.First());
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only return unique users.

@Fosol Fosol merged commit d25f98c into bcgov:dev Aug 16, 2024
2 checks passed
@Fosol Fosol deleted the transcribe branch August 16, 2024 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant