evolution-api icon indicating copy to clipboard operation
evolution-api copied to clipboard

erro ao enviar para grupos com hífen no meio do id

Open magnum1985 opened this issue 1 month ago • 10 comments

Welcome!

  • [x] Yes, I have searched for similar issues on GitHub and found none.

What did you do?

Na versão 2.3.6 o envio da mensagem para grupos com hífen está com problema tive que voltar para versão 2.3.1 para conseguir enviar mensagem para esses grupos!

What did you expect?

enviar mensagem para grupos com hifen

What did you observe instead of what you expected?

enviar mensagem para grupos com hifen

Screenshots/Videos

Image

Which version of the API are you using?

2.3.6

What is your environment?

Windows

Other environment specifications

windows

If applicable, paste the log output

Invalid this.cache.delete() invocation in /evolution/dist/main.js:244:8153 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(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 $s=class{},Ws=class{},Js=class{},Fs=class{};var Ln=class{},Gs=class extends Ln{},qs=class extends Gs{},Hs=class extends Gs{},Vs=class{};var Bn=require("baileys"),Le=class{constructor(s){this.cache=s;this.logger=new v("CacheService");s?this.logger.verbose(cacheservice created using cache engine: ${s.constructor?.name}):this.logger.verbose("cacheservice disabled")}async get(s){if(this.cache)return this.cache.get(s)}async hGet(s,e){if(!this.cache)return null;try{let t=await this.cache.hGet(s,e);return t?JSON.parse(t,Bn.BufferJSON.reviver):null}catch(t){return this.logger.error(t),null}}async set(s,e,t){this.cache&&this.cache.set(s,e,t)}async hSet(s,e,t){if(this.cache)try{let o=JSON.stringify(t,Bn.BufferJSON.replacer);await this.cache.hSet(s,e,o)}catch(o){this.logger.error(o)}}async has(s){if(this.cache)return this.cache.has(s)}async delete(s){if(this.cache)return this.cache.delete( Unique constraint failed on the fields: (remoteJid`)

Additional Notes

No response

magnum1985 avatar Nov 10 '25 13:11 magnum1985

I've identified the same problem here. The error message seems related to caching, but it has nothing to do with caching. Clearing the cache, recreating the connection, or changing any other parameter won't help.

Jeffmartt avatar Nov 10 '25 14:11 Jeffmartt

Tive um cenário assim e o erro era por conta de duplicatas no Banco da Evolution API.

#Consulta para ver duplicatas, se aparecer algum registro com o número 2, é porque tem: SELECT "remoteJid", COUNT(*) as duplicatas FROM "Chat" WHERE "remoteJid" LIKE '%@g.us' GROUP BY "remoteJid" HAVING COUNT(*) > 1;

Comigo só resolvi reinstalando a API. Tentei limpar pelo banco mas sem sucesso. (faça backups antes)

jhefersoncrescencio avatar Nov 10 '25 20:11 jhefersoncrescencio

estou com o mesmo problema aqui, se alguém conseguir identificar/resolver posta aqui.

italotkh avatar Nov 10 '25 21:11 italotkh

eu resolvi fazendo isso

DATABASE_SAVE_DATA_NEW_MESSAGE=false DATABASE_SAVE_MESSAGE_UPDATE=false DATABASE_SAVE_DATA_CONTACTS=false DATABASE_SAVE_DATA_CHATS=false DATABASE_SAVE_DATA_LABELS=false DATABASE_SAVE_DATA_HISTORIC=false DATABASE_SAVE_IS_ON_WHATSAPP=false

nao quero salvar nada no banco msm, acabou q resolveu

lucasthompsonamg avatar Nov 11 '25 00:11 lucasthompsonamg

estou com esse problema desde que atualizei para 2.3.6 e ainda não consegui dar solução

valessiobrito avatar Nov 11 '25 13:11 valessiobrito

Consegui resolver deletando os volumes do container e instalando do zero a 2.3.6, acredito que seja algo na database.

italotkh avatar Nov 12 '25 12:11 italotkh

Consegui resolver deletando os volumes do container e instalando do zero a 2.3.6, acredito que seja algo na database.

@italotkh você fez aquela consulta na base ali que mandei?

SELECT "remoteJid", COUNT(*) as duplicatas FROM "Chat" WHERE "remoteJid" LIKE '%@g.us' GROUP BY "remoteJid" HAVING COUNT(*) > 1;

Na base da Evolution API

jhefersoncrescencio avatar Nov 12 '25 13:11 jhefersoncrescencio

A dica do @lucasthompsonamg de usar:

DATABASE_SAVE_DATA_NEW_MESSAGE=false DATABASE_SAVE_MESSAGE_UPDATE=false DATABASE_SAVE_DATA_CONTACTS=false DATABASE_SAVE_DATA_CHATS=false DATABASE_SAVE_DATA_LABELS=false DATABASE_SAVE_DATA_HISTORIC=false DATABASE_SAVE_IS_ON_WHATSAPP=false

Resolveu pra mim...

Jeffmartt avatar Nov 12 '25 15:11 Jeffmartt

O Ajuste já foi feito, apenas aguardar o lançamento da nova versão contemplando ele. https://github.com/EvolutionAPI/evolution-api/pull/2162

Lucasbrunoferreira avatar Nov 25 '25 14:11 Lucasbrunoferreira

@Lucasbrunoferreira sabe me informar quais os dias são feitos merges e publicadas novas atualizações? O ajuste #2162 eu estou esperando no caso!

magnum1985 avatar Nov 28 '25 17:11 magnum1985