refactor(app) agent refactoring + a little review

This commit is contained in:
imadev
2026-10-31 20:22:16 +03:00
parent 2ef20e7040
commit 362ba16cc4
25 changed files with 240 additions and 375 deletions
+3 -3
View File
@@ -118,6 +118,9 @@ func (s *Store) findIdempotentMessage(ctx context.Context, senderID, chatID uuid
}
func (s *Store) ListMessages(ctx context.Context, userID, chatID uuid.UUID, limit int, cursor *common.CursorKeyCtx) (*common.Page[model.Message], error) {
ctx, cancel := s.withTimeout(ctx)
defer cancel()
isMember, err := s.IsMember(ctx, userID, chatID)
if err != nil {
return nil, err
@@ -131,9 +134,6 @@ func (s *Store) ListMessages(ctx context.Context, userID, chatID uuid.UUID, limi
return nil, common.BadRequest("bad cursor value")
}
ctx, cancel := s.withTimeout(ctx)
defer cancel()
cursorTime, cursorID := cursorValues(cursor)
rows, err := s.pool.Query(ctx, `
SELECT id, chat_id, sender_id, text, created_at