Skip to content

Commit b68cfe0

Browse files
committed
fix: coderabbit problems
1 parent 24fc840 commit b68cfe0

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

internal/deepr/db_storage.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,14 @@ func (s *DBStorage) AddMessage(userID, chatID, message string, sent bool, messag
3434
messageID := uuid.New().String()
3535
// Use double underscore as separator to match Firestore format
3636
sessionID := fmt.Sprintf("%s__%s", userID, chatID)
37-
now := time.Now()
37+
now := time.Now().UTC()
3838

39-
var sentAt *time.Time
39+
sentAt := sql.NullTime{}
4040
if sent {
41-
sentAt = &now
41+
sentAt = sql.NullTime{
42+
Time: now,
43+
Valid: true,
44+
}
4245
}
4346

4447
query := `

internal/deepr/service.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -768,8 +768,7 @@ func (s *Service) handleNewConnection(ctx context.Context, clientConn *websocket
768768
slog.String("message_type", messageType),
769769
slog.Bool("has_final_report", msg.FinalReport != ""),
770770
slog.Int("client_count", clientCount),
771-
slog.Bool("broadcast_success", broadcastErr == nil),
772-
slog.String("raw_message", string(message)))
771+
slog.Bool("broadcast_success", broadcastErr == nil))
773772

774773
// Store message with sent status
775774
if err := s.storage.AddMessage(userID, chatID, string(message), messageSent, messageType); err != nil {
@@ -887,8 +886,7 @@ func (s *Service) handleNewConnection(ctx context.Context, clientConn *websocket
887886
slog.String("chat_id", chatID),
888887
slog.String("message_type", messageType),
889888
slog.Bool("has_final_report", msg.FinalReport != ""),
890-
slog.Bool("broadcast_success", broadcastErr == nil),
891-
slog.String("raw_message", string(message)))
889+
slog.Bool("broadcast_success", broadcastErr == nil))
892890
if broadcastErr != nil {
893891
log.Warn("failed to broadcast message without storage",
894892
slog.String("user_id", userID),

0 commit comments

Comments
 (0)