-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
Welcome!
- Yes, I have searched for similar issues on GitHub and found none.
What did you do?
Ao tentar enviar uma mensagem de texto via API, ocorre o erro 500 - Internal Server Error.
O log aponta uma exceção relacionada à invocação inválida de this.cache.delete() no arquivo main.js.
500 - {"status":500,"error":"Internal Server Error","response":{"message":"Invalid this.cache.delete() invocation in /evolution/dist/main.js:244:8153"}}
Trecho relevante:
241 ),i.url&&(n+=URL:${i.url}
242 ),i.wuid||(i.wuid=G(i.phoneNumber)),n+=item1.TEL;waid=${i.wuid}:${i.phoneNumber}
243 item1.X-ABLabel:Celular
→ 244 END:VCARD,n};return e.contact.length===1?t.contact={displayName:e.contact[0].fullName,vcard:o(e.contact[0])}:t.contactsArrayMessage={displayName:${e.contact.length} contacts,contacts:e.contact.map(i=>({displayName:i.fullName,vcard:o(i)}))},await this.sendMessageWithTyping(...)
...
Unique constraint failed on the fields: (remoteJid)
What did you expect?
A mensagem de texto deve ser enviada com sucesso, sem gerar erro interno no serviço.
What did you observe instead of what you expected?
🧠 Possível causa
Aparentemente, há uma chamada inválida para this.cache.delete() — possivelmente tentando excluir uma chave inexistente ou usando um tipo incorreto de objeto de cache.
O erro pode estar relacionado ao gerenciamento de remoteJid em mensagens enviadas com múltiplos contatos no payload.
Screenshots/Videos
No response
Which version of the API are you using?
"version":"2.3.6"
What is your environment?
Windows
Other environment specifications
Versão da lib / container: (informar exata, ex: v3.12.1)
Runtime: Node.js (versão exata)
SO / ambiente de execução: (ex: Docker / Ubuntu / Windows)
Banco ou cache usado: (ex: Redis, MemoryCache, etc.)
If applicable, paste the log output
Erro ao enviar mensagem de texto
500 - {"status":500,"error":"Internal Server Error","response":{"message":"\nInvalid this.cache.delete() invocation in\n/evolution/dist/main.js:244:8153\n\n 241 ),i.url&&(n+=URL:${i.url}\n 242 ),i.wuid||(i.wuid=G(i.phoneNumber)),n+=item1.TEL;waid=${i.wuid}:${i.phoneNumber}\n 243 item1.X-ABLabel:Celular\n→ 244 END:VCARD,n};return e.contact.length===1?t.contact={displayName:e.contact[0].fullName,vcard:o(e.contact[0])}:t.contactsArrayMessage={displayName:${e.contact.length} contacts,contacts:e.contact.map(i=>({displayName:i.fullName,vcard:o(i)}))},await this.sendMessageWithTyping(e.number,{contacts:e.contact.map(i=>({name:{formatted_name:i.fullName,first_name:i.fullName},phones:[{phone:i.phoneNumber}],urls:[{url:i.url}],emails:[{email:i.email}],org:{company:i.organization}})),message:t},{delay:e?.delay,presence:"composing",quoted:e?.quoted,linkPreview:e?.linkPreview,mentionsEveryOne:e?.mentionsEveryOne,mentioned:e?.mentioned})}async reactionMessage(e){return await this.sendMessageWithTyping(e.key.remoteJid,{reactionMessage:{key:e.key,text:e.reaction}})}async getBase64FromMediaMessage(e){try{let t=e.message,o=t.messageType.includes("Message")?t.messageType:t.messageType+"Message",i=t.message[o];return{mediaType:t.messageType,fileName:i?.fileName,caption:i?.caption,size:{fileLength:i?.fileLength,height:i?.fileLength,width:i?.width},mimetype:i?.mime_type,base64:t.message.base64}}catch(t){throw this.logger.error(t),new y(t.toString())}}async deleteMessage(){throw new y("Method not available on WhatsApp Business API")}async mediaSticker(){throw new y("Method not available on WhatsApp Business API")}async pollMessage(){throw new y("Method not available on WhatsApp Business API")}async statusMessage(){throw new y("Method not available on WhatsApp Business API")}async reloadConnection(){throw new y("Method not available on WhatsApp Business API")}async whatsappNumber(){throw new y("Method not available on WhatsApp Business API")}async markMessageAsRead(){throw new y("Method not available on WhatsApp Business API")}async archiveChat(){throw new y("Method not available on WhatsApp Business API")}async markChatUnread(){throw new y("Method not available on WhatsApp Business API")}async fetchProfile(){throw new y("Method not available on WhatsApp Business API")}async offerCall(){throw new y("Method not available on WhatsApp Business API")}async sendPresence(){throw new y("Method not available on WhatsApp Business API")}async setPresence(){throw new y("Method not available on WhatsApp Business API")}async fetchPrivacySettings(){throw new y("Method not available on WhatsApp Business API")}async updatePrivacySettings(){throw new y("Method not available on WhatsApp Business API")}async fetchBusinessProfile(){throw new y("Method not available on WhatsApp Business API")}async updateProfileName(){throw new y("Method not available on WhatsApp Business API")}async updateProfileStatus(){throw new y("Method not available on WhatsApp Business API")}async updateProfilePicture(){throw new y("Method not available on WhatsApp Business API")}async removeProfilePicture(){throw new y("Method not available on WhatsApp Business API")}async blockUser(){throw new y("Method not available on WhatsApp Business API")}async updateMessage(){throw new y("Method not available on WhatsApp Business API")}async createGroup(){throw new y("Method not available on WhatsApp Business API")}async updateGroupPicture(){throw new y("Method not available on WhatsApp Business API")}async updateGroupSubject(){throw new y("Method not available on WhatsApp Business API")}async updateGroupDescription(){throw new y("Method not available on WhatsApp Business API")}async findGroup(){throw new y("Method not available on WhatsApp Business API")}async fetchAllGroups(){throw new y("Method not available on WhatsApp Business API")}async inviteCode(){throw new y("Method not available on WhatsApp Business API")}async inviteInfo(){throw new y("Method not available on WhatsApp Business API")}async sendInvite(){throw new y("Method not available on WhatsApp Business API")}async acceptInviteCode(){throw new y("Method not available on WhatsApp Business API")}async revokeInviteCode(){throw new y("Method not available on WhatsApp Business API")}async findParticipants(){throw new y("Method not available on WhatsApp Business API")}async updateGParticipant(){throw new y("Method not available on WhatsApp Business API")}async updateGSetting(){throw new y("Method not available on WhatsApp Business API")}async toggleEphemeral(){throw new y("Method not available on WhatsApp Business API")}async leaveGroup(){throw new y("Method not available on WhatsApp Business API")}async fetchLabels(){throw new y("Method not available on WhatsApp Business API")}async handleLabel(){throw new y("Method not available on WhatsApp Business API")}async receiveMobileCode(){throw new y("Method not available on WhatsApp Business API")}async fakeCall(){throw new y("Method not available on WhatsApp Business API")}};var Ke=class{constructor(s,e,t,o,i){this.jid=s;this.exists=e;this.number=t;this.name=o;this.lid=i}},xs=class{},ks=class{},et=class{};var Ls=class{},Bs=class{},bt=class{};var Us=class{};var
Additional Notes
No response