From f7b3926338ccb028fbceee23865cacd5ecda3bf9 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Tue, 11 Nov 2025 00:38:43 +0800 Subject: [PATCH] :necktie: Optimize push notification logic --- .../Storage/PersistentTaskService.cs | 34 +------------------ 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/DysonNetwork.Drive/Storage/PersistentTaskService.cs b/DysonNetwork.Drive/Storage/PersistentTaskService.cs index f6a0c5d..1b3676f 100644 --- a/DysonNetwork.Drive/Storage/PersistentTaskService.cs +++ b/DysonNetwork.Drive/Storage/PersistentTaskService.cs @@ -463,22 +463,6 @@ public class PersistentTaskService( UserId = task.AccountId.ToString(), Packet = wsPacket }); - - // Push notification - var pushNotification = new PushNotification - { - Topic = "drive.tasks", - Title = "Task Completed", - Subtitle = task.Name, - Body = $"Your {task.Type.ToString().ToLower()} task has completed successfully.", - IsSavable = true - }; - - await ringService.SendPushNotificationToUserAsync(new SendPushNotificationToUserRequest - { - UserId = task.AccountId.ToString(), - Notification = pushNotification - }); } catch (Exception ex) { @@ -516,7 +500,7 @@ public class PersistentTaskService( var pushNotification = new PushNotification { Topic = "drive.tasks", - Title = "Task Failed", + Title = "Drive Task Failed", Subtitle = task.Name, Body = $"Your {task.Type.ToString().ToLower()} task has failed.", IsSavable = true @@ -927,22 +911,6 @@ public class PersistentTaskService( UserId = task.AccountId.ToString(), Packet = wsPacket }); - - // Send push notification - var pushNotification = new PushNotification - { - Topic = "drive.tasks.upload", - Title = "Upload Completed", - Subtitle = task.FileName, - Body = $"Your file '{task.FileName}' has been uploaded successfully.", - IsSavable = true - }; - - await ringService.SendPushNotificationToUserAsync(new SendPushNotificationToUserRequest - { - UserId = task.AccountId.ToString(), - Notification = pushNotification - }); } catch (Exception ex) {