| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…der to return always the chatname from the user correctly
Reviewer's Guide by SourceryThis pull request fixes a bug where the name field in the Chat table was being incorrectly updated with an empty string or the sender's name. The fix ensures that the name field is only updated with the correct push name when a message is received, not when it's sent. Sequence diagram for MESSAGES_UPSERT eventsequenceDiagram
participant WhatsApp
participant BaileysService
participant PrismaRepository
participant WebhookService
WhatsApp->>BaileysService: Event: MESSAGES_UPSERT (message received)
BaileysService->>BaileysService: Check if chat exists
alt Chat exists and pushName is valid and fromMe is false and not a group
BaileysService->>PrismaRepository: Update Chat.name with pushName
PrismaRepository-->>BaileysService: Success
BaileysService->>WebhookService: Send CHATS_UPSERT event with updated Chat
WebhookService-->>BaileysService: Acknowledged
else Chat does not exist or pushName is invalid or fromMe is true or is a group
BaileysService->>BaileysService: Do not update Chat.name
end
Updated class diagram for ChatclassDiagram
class Chat {
remoteJid: string
instanceId: string
unreadMessages: number
// name: string - Removed from initial creation
}
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.
|
Talvez vc consiga resolver este bug também: #1367 chegou a ocorrer com vc? |
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.
Summary by Sourcery
Fix the behavior of updating chat names during message events to prevent incorrect name updates
Bug Fixes:
Enhancements: