diff --git a/src/Core/Enums/PushType.cs b/src/Core/Enums/PushType.cs index 96a1192478..07c40f94a2 100644 --- a/src/Core/Enums/PushType.cs +++ b/src/Core/Enums/PushType.cs @@ -31,5 +31,5 @@ public enum PushType : byte Notification = 20, NotificationStatus = 21, - PendingSecurityTasks = 22 + RefreshSecurityTasks = 22 } diff --git a/src/Core/Platform/Push/Services/IPushNotificationService.cs b/src/Core/Platform/Push/Services/IPushNotificationService.cs index 58b8a4722d..c6da6cf6b7 100644 --- a/src/Core/Platform/Push/Services/IPushNotificationService.cs +++ b/src/Core/Platform/Push/Services/IPushNotificationService.cs @@ -389,10 +389,10 @@ public interface IPushNotificationService ExcludeCurrentContext = false, }); - Task PushPendingSecurityTasksAsync(Guid userId) + Task PushRefreshSecurityTasksAsync(Guid userId) => PushAsync(new PushNotification { - Type = PushType.PendingSecurityTasks, + Type = PushType.RefreshSecurityTasks, Target = NotificationTarget.User, TargetId = userId, Payload = new UserPushNotification diff --git a/src/Core/Vault/Commands/CreateManyTaskNotificationsCommand.cs b/src/Core/Vault/Commands/CreateManyTaskNotificationsCommand.cs index e68a2ed726..98a4bea591 100644 --- a/src/Core/Vault/Commands/CreateManyTaskNotificationsCommand.cs +++ b/src/Core/Vault/Commands/CreateManyTaskNotificationsCommand.cs @@ -89,7 +89,7 @@ public class CreateManyTaskNotificationsCommand : ICreateManyTaskNotificationsCo } // Notify the user that they have pending security tasks - await _pushNotificationService.PushPendingSecurityTasksAsync(userId); + await _pushNotificationService.PushRefreshSecurityTasksAsync(userId); } } } diff --git a/src/Core/Vault/Commands/MarkNotificationsForTaskAsDeletedCommand.cs b/src/Core/Vault/Commands/MarkNotificationsForTaskAsDeletedCommand.cs index 8d1e6e4538..65fe98a4d2 100644 --- a/src/Core/Vault/Commands/MarkNotificationsForTaskAsDeletedCommand.cs +++ b/src/Core/Vault/Commands/MarkNotificationsForTaskAsDeletedCommand.cs @@ -26,7 +26,7 @@ public class MarkNotificationsForTaskAsDeletedCommand : IMarkNotificationsForTas var uniqueUserIds = userIds.Distinct(); foreach (var id in uniqueUserIds) { - await _pushNotificationService.PushPendingSecurityTasksAsync(id); + await _pushNotificationService.PushRefreshSecurityTasksAsync(id); } } } diff --git a/src/Notifications/HubHelpers.cs b/src/Notifications/HubHelpers.cs index 441842da3b..c8ce3ecfe5 100644 --- a/src/Notifications/HubHelpers.cs +++ b/src/Notifications/HubHelpers.cs @@ -135,7 +135,7 @@ public static class HubHelpers } break; - case PushType.PendingSecurityTasks: + case PushType.RefreshSecurityTasks: var pendingTasksData = JsonSerializer.Deserialize>(notificationJson, _deserializerOptions); await hubContext.Clients.User(pendingTasksData.Payload.UserId.ToString()) .SendAsync(_receiveMessageMethod, pendingTasksData, cancellationToken); diff --git a/test/Api.IntegrationTest/Platform/Controllers/PushControllerTests.cs b/test/Api.IntegrationTest/Platform/Controllers/PushControllerTests.cs index 4d86817a11..32d6389616 100644 --- a/test/Api.IntegrationTest/Platform/Controllers/PushControllerTests.cs +++ b/test/Api.IntegrationTest/Platform/Controllers/PushControllerTests.cs @@ -166,7 +166,7 @@ public class PushControllerTests yield return UserTyped(PushType.SyncOrgKeys); yield return UserTyped(PushType.SyncSettings); yield return UserTyped(PushType.LogOut); - yield return UserTyped(PushType.PendingSecurityTasks); + yield return UserTyped(PushType.RefreshSecurityTasks); yield return Typed(new PushSendRequestModel { diff --git a/test/Core.Test/Platform/Push/Services/AzureQueuePushNotificationServiceTests.cs b/test/Core.Test/Platform/Push/Services/AzureQueuePushNotificationServiceTests.cs index 4e2ec19086..b223ef7252 100644 --- a/test/Core.Test/Platform/Push/Services/AzureQueuePushNotificationServiceTests.cs +++ b/test/Core.Test/Platform/Push/Services/AzureQueuePushNotificationServiceTests.cs @@ -707,7 +707,7 @@ public class AzureQueuePushNotificationServiceTests } [Fact] - public async Task PushPendingSecurityTasksAsync_SendsExpectedResponse() + public async Task PushRefreshSecurityTasksAsync_SendsExpectedResponse() { var userId = Guid.NewGuid(); @@ -722,7 +722,7 @@ public class AzureQueuePushNotificationServiceTests }; await VerifyNotificationAsync( - async sut => await sut.PushPendingSecurityTasksAsync(userId), + async sut => await sut.PushRefreshSecurityTasksAsync(userId), expectedPayload ); } diff --git a/test/Core.Test/Platform/Push/Services/NotificationsApiPushNotificationServiceTests.cs b/test/Core.Test/Platform/Push/Services/NotificationsApiPushNotificationServiceTests.cs index 92706c6ccc..5231456d63 100644 --- a/test/Core.Test/Platform/Push/Services/NotificationsApiPushNotificationServiceTests.cs +++ b/test/Core.Test/Platform/Push/Services/NotificationsApiPushNotificationServiceTests.cs @@ -368,7 +368,7 @@ public class NotificationsApiPushNotificationServiceTests : PushTestBase }; } - protected override JsonNode GetPushPendingSecurityTasksResponsePayload(Guid userId) + protected override JsonNode GetPushRefreshSecurityTasksResponsePayload(Guid userId) { return new JsonObject { diff --git a/test/Core.Test/Platform/Push/Services/PushTestBase.cs b/test/Core.Test/Platform/Push/Services/PushTestBase.cs index 3538a68127..3ff09f1064 100644 --- a/test/Core.Test/Platform/Push/Services/PushTestBase.cs +++ b/test/Core.Test/Platform/Push/Services/PushTestBase.cs @@ -93,7 +93,7 @@ public abstract class PushTestBase protected abstract JsonNode GetPushNotificationStatusResponsePayload(Notification notification, NotificationStatus notificationStatus, Guid? userId, Guid? organizationId); protected abstract JsonNode GetPushSyncOrganizationStatusResponsePayload(Organization organization); protected abstract JsonNode GetPushSyncOrganizationCollectionManagementSettingsResponsePayload(Organization organization); - protected abstract JsonNode GetPushPendingSecurityTasksResponsePayload(Guid userId); + protected abstract JsonNode GetPushRefreshSecurityTasksResponsePayload(Guid userId); [Fact] public async Task PushSyncCipherCreateAsync_SendsExpectedResponse() @@ -444,13 +444,13 @@ public abstract class PushTestBase } [Fact] - public async Task PushPendingSecurityTasksAsync_SendsExpectedResponse() + public async Task PushRefreshSecurityTasksAsync_SendsExpectedResponse() { var userId = Guid.NewGuid(); await VerifyNotificationAsync( - async sut => await sut.PushPendingSecurityTasksAsync(userId), - GetPushPendingSecurityTasksResponsePayload(userId) + async sut => await sut.PushRefreshSecurityTasksAsync(userId), + GetPushRefreshSecurityTasksResponsePayload(userId) ); } diff --git a/test/Core.Test/Platform/Push/Services/RelayPushNotificationServiceTests.cs b/test/Core.Test/Platform/Push/Services/RelayPushNotificationServiceTests.cs index f95531c944..ddad05eda0 100644 --- a/test/Core.Test/Platform/Push/Services/RelayPushNotificationServiceTests.cs +++ b/test/Core.Test/Platform/Push/Services/RelayPushNotificationServiceTests.cs @@ -491,7 +491,7 @@ public class RelayPushNotificationServiceTests : PushTestBase }; } - protected override JsonNode GetPushPendingSecurityTasksResponsePayload(Guid userId) + protected override JsonNode GetPushRefreshSecurityTasksResponsePayload(Guid userId) { return new JsonObject {