| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Reviewer's Guide by SourceryThis pull request fixes a bug in the findChats endpoint and implements pagination for the findChats and findContacts endpoints. The bug fix ensures that the correct chat name is returned, while the pagination feature improves performance for users with many contacts and chats. Sequence diagram for fetching chat namesequenceDiagram
participant Client
participant ChannelStartupService
participant PrismaRepository
Client->>ChannelStartupService: Calls findChats endpoint
ChannelStartupService->>PrismaRepository: Executes raw SQL query to fetch chats
PrismaRepository-->>ChannelStartupService: Returns chat data including chatName from Chat table
ChannelStartupService-->>Client: Returns chat data with correct chatName
Sequence diagram for Contact PaginationsequenceDiagram
participant Client
participant ChannelStartupService
participant PrismaRepository
Client->>ChannelStartupService: Calls findContacts endpoint with page and offset
ChannelStartupService->>PrismaRepository: Calls contact.findMany with take and skip parameters
PrismaRepository-->>ChannelStartupService: Returns paginated contact data
ChannelStartupService-->>Client: Returns paginated contact data
Updated class diagram for ChannelStartupServiceclassDiagram
class ChannelStartupService {
+findContacts(query: any): Promise<Contact[]>
+findChats(query: any): Promise<Chat[]>
}
class Contact {
id: string
remoteJid: string
pushName: string
chatName: string
profilePicUrl: string
updatedAt: Date
windowStart: Date
}
note for Contact "Added chatName attribute"
class Chat {
name: string
createdAt: Date
}
ChannelStartupService -- Contact : returns
File-Level Changes
Tips and commands Interacting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Sorry, something went wrong.
There was a problem hiding this comment.
Hey @pedro-php - I've reviewed your changes - here's some feedback:
Overall Comments:
Sorry, something went wrong.
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
|
up |
Sorry, something went wrong.
|
up |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fix
Problema
Ao enviar uma mensagem via dispositivo, dois comportamentos distintos ocorriam:
O que foi alterado?
Resolução
Agora, ao chamar um endpoint que retorna o campo name da tabela Chat (como o /chat/findChats/), o valor retornado será o correto — evitando strings vazias ou o nome do próprio remetente. O campo continua sendo atualizado normalmente ao receber mensagens.