@@ -2,6 +2,7 @@ package users
22
33import (
44 "context"
5+ "fmt"
56 "net/http"
67 "time"
78
@@ -67,6 +68,7 @@ func (s *UserService) RequestDeletion(ctx context.Context, userID int) (int, int
6768 }
6869 }
6970
71+ s .ws .SetPendingDeletionForUser (userID , true )
7072 s .ws .BroadcastToUser (userID , ws.WSResponse {
7173 Action : "account_deletion_requested" ,
7274 Data : gin.H {},
@@ -85,6 +87,7 @@ func (s *UserService) CancelDeletion(ctx context.Context, userID int) (int, inte
8587 }
8688 }
8789
90+ s .ws .SetPendingDeletionForUser (userID , false )
8891 s .ws .BroadcastToUser (userID , ws.WSResponse {
8992 Action : "account_deletion_cancelled" ,
9093 Data : gin.H {},
@@ -102,11 +105,11 @@ func (s *UserService) ProcessDeletions(ctx context.Context) error {
102105 }
103106
104107 for _ , user := range users {
105- log .Infof ("deleting account for user %d (requested at %s )" , user .ID , user .DeletionRequestedAt )
108+ log .Infof ("deleting account for user %d (requested at %v )" , user .ID , user .DeletionRequestedAt )
106109 if err := s .r .DeleteUser (ctx , user .ID ); err != nil {
107110 log .Errorf ("failed to delete user %d: %s" , user .ID , err .Error ())
108111 telemetry .TrackError (ctx , "account_deletion_failed" , "user-service" , err , map [string ]string {
109- "user_id" : string ( rune ( user .ID ) ),
112+ "user_id" : fmt . Sprint ( user .ID ),
110113 })
111114 }
112115 }
0 commit comments