diff --git a/go-backend/internal/handlers/post_handler.go b/go-backend/internal/handlers/post_handler.go index 0ac877f..111e98a 100644 --- a/go-backend/internal/handlers/post_handler.go +++ b/go-backend/internal/handlers/post_handler.go @@ -497,12 +497,13 @@ func (h *PostHandler) SavePost(c *gin.Context) { // Send push notification to post author go func() { - post, err := h.postRepo.GetPostByID(c.Request.Context(), postID, userIDStr.(string)) + bgCtx := context.Background() + post, err := h.postRepo.GetPostByID(bgCtx, postID, userIDStr.(string)) if err != nil || post.AuthorID.String() == userIDStr.(string) { return // Don't notify self } - actor, err := h.userRepo.GetProfileByID(c.Request.Context(), userIDStr.(string)) + actor, err := h.userRepo.GetProfileByID(bgCtx, userIDStr.(string)) if err != nil || h.notificationService == nil { return } @@ -521,7 +522,7 @@ func (h *PostHandler) SavePost(c *gin.Context) { "post_type": postType, } h.notificationService.CreateNotification( - c.Request.Context(), + context.Background(), post.AuthorID.String(), userIDStr.(string), "save",