From 01bd75895ac22a0c87504361fa0afb4f47b06f30 Mon Sep 17 00:00:00 2001 From: James Gunn Date: Thu, 7 Mar 2024 11:36:41 +0000 Subject: [PATCH] Fix the properties on UserMergedMessage - they were backwards --- .../Notifications/Messages/UserMergedMessage.cs | 2 +- .../Notifications/PublishNotificationsEventObserver.cs | 4 ++-- .../WebHooks/WebHooksEndToEndTests.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dotnet-authserver/src/TeacherIdentity.AuthServer/Notifications/Messages/UserMergedMessage.cs b/dotnet-authserver/src/TeacherIdentity.AuthServer/Notifications/Messages/UserMergedMessage.cs index c09880a5c..5c5887aa9 100644 --- a/dotnet-authserver/src/TeacherIdentity.AuthServer/Notifications/Messages/UserMergedMessage.cs +++ b/dotnet-authserver/src/TeacherIdentity.AuthServer/Notifications/Messages/UserMergedMessage.cs @@ -5,5 +5,5 @@ public record UserMergedMessage : INotificationMessage public const string MessageTypeName = "UserMerged"; public required Guid MergedUserId { get; init; } - public required User MasterUser { get; init; } + public required Guid MasterUserId { get; init; } } diff --git a/dotnet-authserver/src/TeacherIdentity.AuthServer/Notifications/PublishNotificationsEventObserver.cs b/dotnet-authserver/src/TeacherIdentity.AuthServer/Notifications/PublishNotificationsEventObserver.cs index 8da08ba93..00a9d7e13 100644 --- a/dotnet-authserver/src/TeacherIdentity.AuthServer/Notifications/PublishNotificationsEventObserver.cs +++ b/dotnet-authserver/src/TeacherIdentity.AuthServer/Notifications/PublishNotificationsEventObserver.cs @@ -74,8 +74,8 @@ private static IEnumerable GetNotificationsForEvent(EventB NotificationId = Guid.NewGuid(), Message = new UserMergedMessage() { - MasterUser = userMerged.User, - MergedUserId = userMerged.MergedWithUserId + MasterUserId = userMerged.MergedWithUserId, + MergedUserId = userMerged.User.UserId }, MessageType = UserMergedMessage.MessageTypeName, TimeUtc = userMerged.CreatedUtc diff --git a/dotnet-authserver/tests/TeacherIdentity.AuthServer.Tests/WebHooks/WebHooksEndToEndTests.cs b/dotnet-authserver/tests/TeacherIdentity.AuthServer.Tests/WebHooks/WebHooksEndToEndTests.cs index 53dbc1b08..cc768cf68 100644 --- a/dotnet-authserver/tests/TeacherIdentity.AuthServer.Tests/WebHooks/WebHooksEndToEndTests.cs +++ b/dotnet-authserver/tests/TeacherIdentity.AuthServer.Tests/WebHooks/WebHooksEndToEndTests.cs @@ -381,7 +381,7 @@ public async Task UserMerged_WhenPublished_IsOnlySentToWebHookEndpointsWhichSubs NotificationId = Guid.NewGuid(), Message = new UserMergedMessage() { - MasterUser = user, + MasterUserId = user.UserId, MergedUserId = mergedUserId }, MessageType = UserMergedMessage.MessageTypeName,