Skip to content

Commit

Permalink
Merge pull request #957 from 0xff-dev/fix-list-conversation
Browse files Browse the repository at this point in the history
fix: the application does not exist and does not affect other icon co…
  • Loading branch information
bjwswang authored Mar 29, 2024
2 parents b6ef2f3 + ee69e10 commit fc3ffd9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion apiserver/pkg/chat/chat_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,10 @@ func (cs *ChatServer) FillAppIconToConversations(ctx context.Context, conversati
}
err := cs.cli.Get(ctx, types.NamespacedName{Namespace: ns, Name: name}, app)
if err != nil {
return err
// FIXME: Currently, there is a request for an application that cannot be found in a conversation in the database,
// causing other conversations to be unable to add icons, so an error is encountered here and no error is returned.
klog.Errorf("failed to get application %s in namespace %s, error %s", name, ns, err)
return nil
}
result[index] = app.Spec.Icon
return nil
Expand Down
2 changes: 1 addition & 1 deletion apiserver/pkg/chat/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type Conversation struct {
Debug bool `gorm:"column:debug;type:bool;comment:debug mode" json:"-"`
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:time;comment:the time the conversation deleted at" json:"-"`
// icon only valid in conversation list api
Icon string `gorm:"-" json:"icon,omitempty"`
Icon string `gorm:"-" json:"icon"`
}

// Message represent a message in storage
Expand Down

0 comments on commit fc3ffd9

Please sign in to comment.