Cobalt icon indicating copy to clipboard operation
Cobalt copied to clipboard

Encryption/Decryption issues related to messages megathread

Open ModoloDev opened this issue 7 months ago • 54 comments

I’m having a problem: some of the messages I try to send aren’t going through. The message status just shows “SERVER_ACK.” Usually only a few messages fail, but in my last test I tried sending ten messages at intervals of 10–30 seconds, and none of them were delivered.

I don’t know why, but none of the messages I’m sending right now are going through.

Image

Any idea what’s causing this?

Note: Web API

ModoloDev avatar May 27 '25 17:05 ModoloDev

I am getting a error similiar, if not the same, messages are shown as delivered, but status is "SERVER_ACK", the receiver don't receive the message on WhatsApp app and receives this message on WhatsApp Windows App (Web):

Image

Image

This is how I am sending the message:

Whatsapp.getWhatsapp().sendMessage(chat, "Mensagem de teste").join();

This is the WhatsApp connection:

    private static void onConnectionRequest() {
        whatsapp = webBuilder()
            .newConnection(Willy.getWilly().getName())
            .autodetectListeners(false)
            .mediaProxySetting(MediaProxySetting.NONE)
            .automaticMessageReceipts(false)
            .textPreviewSetting(TextPreviewSetting.DISABLED)
            .historySetting(WebHistorySetting.discard(true))
            .name(STR."\{Willy.getWilly().getName()} \{Config.getString("environment")}")
            .errorHandler(WhatsappHandler::onError)
            .unregistered(QrHandler.toFile(WhatsappHandler::onQRCode ))
            .addListener(new WhatsappListener());

        //TODO Temp fix till version 0.0.10 is released
        whatsapp.store()
            .setDevice(CompanionDevice.web(Version.of("2.3000.1023231279")));

        whatsapp.connect().join();
    }

I am using Cobalt version 0.0.9 with maven and Java 21.

laravieira avatar Jun 21 '25 23:06 laravieira

Although i'm not having this problem on development, a client is having the same problem as @laravieira Aguardando mensagem ("Awaiting for message")

I woud recommend trying to clean the .cobalt file C:\Users\Usuário.cobalt and reconnecting

Code i use for connecting:

Whatsapp instance = Whatsapp.webBuilder()
		    .newConnection(uuid)
		    .historySetting(WebHistorySetting.discard(false))
		    .mediaProxySetting(MediaProxySetting.NONE)
		    .automaticMessageReceipts(false)
		    .textPreviewSetting(TextPreviewSetting.DISABLED)
		    .unregistered(QrHandler.toFile(arquivo.toPath(), qrConsumer))
		    .addLoggedInListener((conn) -> {
			    System.out.println("Conexão criada UUID: " + uuid.toString());
		    })
		    .addNewChatMessageListener(message -> {})
		    .connect()
		    .join();

Waiting for feedback on this solution

vitorhugoze avatar Jun 23 '25 19:06 vitorhugoze

No, I don't think this problem is related to the .cobalt file. I've already tried cleaning it. Like I said before, I'm not having this problem every time — just often, in some chats. Therefore, I have a theory: I think it's something from WhatsApp itself that is blocking messages in chats we use too frequently. I don't know why it's occurring.

ModoloDev avatar Jun 23 '25 19:06 ModoloDev

i too face this issue

my observations

  1. Register wa by QR Login method.
  2. security keys for chats are sync to .cobal folder
  3. due to some mobile network issues security key at companion device is changed, but in our .cobal folder old security key is there for that contact , if we send the chat with old secret key, wa can't decrypt, so showing "waiting for this message"
  4. i am restarting my spring boot server frequently ( every 1hr ), assuming it may re-sync for any new keys. but not happening.

this is happening for some contacts only, other contacts working fine.

NarayanaBoddu avatar Jul 11 '25 02:07 NarayanaBoddu

i too face this issue

my observations

  1. Register wa by QR Login method.
  2. security keys for chats are sync to .cobal folder
  3. due to some mobile network issues security key at companion device is changed, but in our .cobal folder old security key is there for that contact , if we send the chat with old secret key, wa can't decrypt, so showing "waiting for this message"
  4. i am restarting my spring boot server frequently ( every 1hr ), assuming it may re-sync for any new keys. but not happening.

this is happening for some contacts only, other contacts working fine.

can you try 0.0.10 and see if it works?

Auties00 avatar Jul 20 '25 16:07 Auties00

I can confirm that this is still happening in 0.0.10

sujithifi avatar Jul 24 '25 05:07 sujithifi

Can also confirm not working in 0.0.10

Image

Onako2 avatar Aug 08 '25 18:08 Onako2

Can also confirm not working in 0.0.10

Image

do you mind cloning the master branch and trying again? use a new session

Auties00 avatar Aug 08 '25 19:08 Auties00

Can also confirm not working in 0.0.10 Image

do you mind cloning the master branch and trying again? use a new session

Will try, if you want we can do Discord call so we can test together :)

Onako2 avatar Aug 08 '25 19:08 Onako2

THANKS! Seems to work now.

Onako2 avatar Aug 08 '25 20:08 Onako2

Never mind. Currently I am getting connect and instant disconnect

Aug 08, 2025 11:15:39 PM it.auties.whatsapp.api.WhatsappErrorHandler lambda$defaultErrorHandler$3 SEVERE: [381644836689] Socket failure at MESSAGE: Critical failure it.auties.whatsapp.exception.HmacValidationException: message_decryption at it.auties.whatsapp.crypto.SignalSession.decrypt(SignalSession.java:137) at it.auties.whatsapp.crypto.SignalSession.decrypt(SignalSession.java:116) at it.auties.whatsapp.socket.message.MessageComponent.decodeMessageBytes(MessageComponent.java:1133) at it.auties.whatsapp.socket.message.MessageComponent.decodeChatMessageContainer(MessageComponent.java:1065) at it.auties.whatsapp.socket.message.MessageComponent.decodeChatMessage(MessageComponent.java:1023) at it.auties.whatsapp.socket.message.MessageComponent.lambda$decode$28(MessageComponent.java:795) at java.base/java.lang.Iterable.forEach(Iterable.java:75) at it.auties.whatsapp.socket.message.MessageComponent.decode(MessageComponent.java:795) at it.auties.whatsapp.socket.SocketConnection.decodeMessage(SocketConnection.java:280) at it.auties.whatsapp.socket.stream.MessageHandler.execute(MessageHandler.java:13) at it.auties.whatsapp.socket.stream.NodeHandler$Executor.lambda$handle$0(NodeHandler.java:38) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.lang.VirtualThread.run(VirtualThread.java:329)

Whatsapp on the phone is also saying that it didn't reconnect

Onako2 avatar Aug 08 '25 20:08 Onako2

~Seems to occur whenever I create a new session by restarting the program~

~Nvm. I don't know it myself. This is so confusing. Will put it on my server and test it on it then~

Nvm. again. It always looses the thing after a while

Onako2 avatar Aug 08 '25 20:08 Onako2

~Seems to occur whenever I create a new session by restarting the program~

~Nvm. I don't know it myself. This is so confusing. Will put it on my server and test it on it then~

Nvm. again. It always looses the thing after a while

What do you mean by loose the thing? Also do you mind deleting the .cobalt repo in the home repo just to be sure.

Auties00 avatar Aug 08 '25 20:08 Auties00

~Seems to occur whenever I create a new session by restarting the program~ ~Nvm. I don't know it myself. This is so confusing. Will put it on my server and test it on it then~ Nvm. again. It always looses the thing after a while

What do you mean by loose the thing? Also do you mind deleting the .cobalt repo in the home repo just to be sure.

Will do it now :D

Onako2 avatar Aug 08 '25 20:08 Onako2

Image idk. if this is related to the issue.

Onako2 avatar Aug 08 '25 20:08 Onako2

Image idk. if this is related to the issue.

so just the first message doesn't arrive? the others do?

Auties00 avatar Aug 08 '25 21:08 Auties00

Image idk. if this is related to the issue.

so just the first message doesn't arrive? the others do?

seems like until I restart the session seems like. Will test further. Would it be possible to join some call (so I can share the screen with you)?

Onako2 avatar Aug 08 '25 21:08 Onako2

Image idk. if this is related to the issue.

so just the first message doesn't arrive? the others do?

seems like until I restart the session seems like. Will test further. Would it be possible to join some call (so I can share the screen with you)?

i can join a call in an hour or so, in the meanwhile can you explain better when the issue happens and if it happens also on Whatsapp Web or only on Whatsapp Desktop? Does it happen only for the first message? Does it happen for the next messages? Does it happen only when the session is started? Or only when is it resumed? Or for both?

Auties00 avatar Aug 08 '25 21:08 Auties00

Image idk. if this is related to the issue.

so just the first message doesn't arrive? the others do?

seems like until I restart the session seems like. Will test further. Would it be possible to join some call (so I can share the screen with you)?

i can join a call in an hour or so, in the meanwhile can you explain better when the issue happens and if it happens also on Whatsapp Web or only on Whatsapp Desktop? Does it happen only for the first message? Does it happen for the next messages? Does it happen only when the session is started? Or only when is it resumed? Or for both?

How do you mean desktop or web? Currently I have one theory:

  • Skill issue on my side. I was trying to do some sketchy stuff but seems to not occur anymore now
  • Or it is the famous presentation effect

Onako2 avatar Aug 08 '25 21:08 Onako2

Found issue now.

So: When I wrote on my non-bot phone and then wrote from my bot-phone back while the bot was down it stopped working

Image
SEVERE: [381644836689] Socket failure at MESSAGE: Critical failure
it.auties.whatsapp.exception.HmacValidationException: message_decryption
	at it.auties.whatsapp.crypto.SignalSession.decrypt(SignalSession.java:137)
	at it.auties.whatsapp.crypto.SignalSession.decrypt(SignalSession.java:116)
	at it.auties.whatsapp.socket.message.MessageComponent.decodeMessageBytes(MessageComponent.java:1133)
	at it.auties.whatsapp.socket.message.MessageComponent.decodeChatMessageContainer(MessageComponent.java:1065)
	at it.auties.whatsapp.socket.message.MessageComponent.decodeChatMessage(MessageComponent.java:1023)
	at it.auties.whatsapp.socket.message.MessageComponent.lambda$decode$28(MessageComponent.java:795)
	at java.base/java.lang.Iterable.forEach(Iterable.java:75)
	at it.auties.whatsapp.socket.message.MessageComponent.decode(MessageComponent.java:795)
	at it.auties.whatsapp.socket.SocketConnection.decodeMessage(SocketConnection.java:280)
	at it.auties.whatsapp.socket.stream.MessageHandler.execute(MessageHandler.java:13)
	at it.auties.whatsapp.socket.stream.NodeHandler$Executor.lambda$handle$0(NodeHandler.java:38)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.VirtualThread.run(VirtualThread.java:329)

Onako2 avatar Aug 08 '25 21:08 Onako2

Found issue now.

So: When I wrote on my non-bot phone and then wrote from my bot-phone back while the bot was down it stopped working

Image SEVERE: [381644836689] Socket failure at MESSAGE: Critical failure it.auties.whatsapp.exception.HmacValidationException: message_decryption at it.auties.whatsapp.crypto.SignalSession.decrypt(SignalSession.java:137) at it.auties.whatsapp.crypto.SignalSession.decrypt(SignalSession.java:116) at it.auties.whatsapp.socket.message.MessageComponent.decodeMessageBytes(MessageComponent.java:1133) at it.auties.whatsapp.socket.message.MessageComponent.decodeChatMessageContainer(MessageComponent.java:1065) at it.auties.whatsapp.socket.message.MessageComponent.decodeChatMessage(MessageComponent.java:1023) at it.auties.whatsapp.socket.message.MessageComponent.lambda$decode$28(MessageComponent.java:795) at java.base/java.lang.Iterable.forEach(Iterable.java:75) at it.auties.whatsapp.socket.message.MessageComponent.decode(MessageComponent.java:795) at it.auties.whatsapp.socket.SocketConnection.decodeMessage(SocketConnection.java:280) at it.auties.whatsapp.socket.stream.MessageHandler.execute(MessageHandler.java:13) at it.auties.whatsapp.socket.stream.NodeHandler$Executor.lambda$handle$0(NodeHandler.java:38) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.lang.VirtualThread.run(VirtualThread.java:329)

Is this the web application(web.whatsapp.com) or the Windows Desktop Client? Can you retry but running the example called MobileLoginExample(it's a class in the tests directory)? Maybe it's the code you wrote, which obv shouldn't happen but then maybe we can narrow down the problem

Auties00 avatar Aug 08 '25 21:08 Auties00

This is my java code which communicates with Whatsapp (The event listener is not important as it is doing nothing currently)

package rs.majic.ampere.whatsapp;

import it.auties.whatsapp.api.Whatsapp;
import it.auties.whatsapp.api.WhatsappVerificationHandler;
import it.auties.whatsapp.api.WhatsappWebHistoryPolicy;
import it.auties.whatsapp.model.message.model.Message;
import it.auties.whatsapp.model.message.model.MessageContainer;
import it.auties.whatsapp.model.message.standard.TextMessage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import rs.majic.ampere.Config;
import rs.majic.ampere.EventSystem;

import java.util.Random;

import static rs.majic.ampere.Main.logger;

public class WhatsappMain {
    private static final Logger log = LoggerFactory.getLogger(WhatsappMain.class);
    public static Whatsapp whatsapp;

    public static void init() {
        whatsapp = Whatsapp.builder()
                .webClient() // Use the Web api
                .newConnection(Config.config.uuid()) // Create a new connection
                .historySetting(WhatsappWebHistoryPolicy.extended(true))
                .unregistered(WhatsappVerificationHandler.Web.QrCode.toFile(WhatsappVerificationHandler.Web.QrCode.ToFile.toDesktop()))
                .addLoggedInListener(api -> {
                    System.out.printf("Connected: %s%n", api.store().privacySettings());
                    try {
                        api.sendChatMessage(api.store().chats().getFirst(), "Hello, World!");
                    } catch (Exception e) {
                        logger.error(e);
                    }
                })
                .addDisconnectedListener(reason -> System.out.printf("Disconnected: %s%n", reason))
                .connect();

        whatsapp.addNewChatMessageListener(chatMessageInfo -> {
                    //if (chatMessageInfo.fromMe()) return;
                    MessageContainer container = chatMessageInfo.message();
                    String sender = chatMessageInfo.senderName();
                    String chatName = chatMessageInfo.chatName();
                    logger.info(container.content().type());
                    if (container.content().type() == Message.Type.TEXT) {
                        TextMessage textMessage = (TextMessage) container.content();
                        logger.info("{} | {}: {}", chatName, sender, textMessage.text());
                        if (textMessage.text().toLowerCase().startsWith("!hello-world")) {
                            logger.info("Hello, World!");
                            whatsapp.sendChatMessage(whatsapp.store().findChatByName(chatName).get(), "Hello, World! " + new Random().nextLong());
                        }
                    }
                });

        try {
            EventSystem.registerSchuelerportalListener(new ListenerWhatsapp(whatsapp));
            if (!whatsapp.isConnected()) {
                whatsapp.connect();
            }
        } catch (Exception e) {
            logger.error("Failed to initialize Whatsapp listener for Vertretungsplan.", e);
        }
    }
}

Onako2 avatar Aug 08 '25 21:08 Onako2

Image

Ok, pinned problem down. It is not the code. It is that when the bot phone send a message manually that that thing is stopping to work

Onako2 avatar Aug 08 '25 21:08 Onako2

Image Ok, pinned problem down. It is not the code. It is that when the bot phone send a message manually that that thing is stopping to work

It's so weird, it works for me. Can you confirm if you are running from Whatsapp Web or Whatsapp Desktop? Which OS for Web/Desktop? Whatsapp personal or business? Which OS is on the companion phone?

Auties00 avatar Aug 08 '25 21:08 Auties00

I am using Windows with Whatsapp personal and a Nokia 7.1 (Android 10) as the companion phone

Onako2 avatar Aug 08 '25 21:08 Onako2

I am using Windows with Whatsapp personal and a Nokia 7.1 (Android 10) as the companion phone

Interesting, I've never seen an HmacValidationException there. What happens if you debug and just skip the check? Does it decrypt it then? I really doubt it but just to see

Auties00 avatar Aug 08 '25 21:08 Auties00

I am using Windows with Whatsapp personal and a Nokia 7.1 (Android 10) as the companion phone

Interesting, I've never seen an HmacValidationException there. What happens if you debug and just skip the check? Does it decrypt it then? I really doubt it but just to see

Aug 09, 2025 1:12:21 AM it.auties.whatsapp.api.WhatsappErrorHandler lambda$defaultErrorHandler$3 SEVERE: [NUMBER] Socket failure at MESSAGE: Ignored failure java.lang.IllegalArgumentException: Cannot decrypt data at it.auties.whatsapp.crypto.SignalSession.decrypt(SignalSession.java:160) at it.auties.whatsapp.crypto.SignalSession.decrypt(SignalSession.java:130) at it.auties.whatsapp.socket.message.MessageComponent.decodeMessageBytes(MessageComponent.java:1133) at it.auties.whatsapp.socket.message.MessageComponent.decodeChatMessageContainer(MessageComponent.java:1065) at it.auties.whatsapp.socket.message.MessageComponent.decodeChatMessage(MessageComponent.java:1023) at it.auties.whatsapp.socket.message.MessageComponent.lambda$decode$28(MessageComponent.java:795) at java.base/java.lang.Iterable.forEach(Iterable.java:75) at it.auties.whatsapp.socket.message.MessageComponent.decode(MessageComponent.java:795) at it.auties.whatsapp.socket.SocketConnection.decodeMessage(SocketConnection.java:280) at it.auties.whatsapp.socket.stream.MessageHandler.execute(MessageHandler.java:13) at it.auties.whatsapp.socket.stream.NodeHandler$Executor.lambda$handle$0(NodeHandler.java:38) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.lang.VirtualThread.run(VirtualThread.java:329) Caused by: javax.crypto.BadPaddingException: Given final block not properly padded. Such issues can arise if a bad key is used during decryption. at java.base/com.sun.crypto.provider.CipherCore.unpad(CipherCore.java:861) at java.base/com.sun.crypto.provider.CipherCore.fillOutputBuffer(CipherCore.java:941) at java.base/com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:734) at java.base/com.sun.crypto.provider.AESCipher.engineDoFinal(AESCipher.java:446) at java.base/javax.crypto.Cipher.doFinal(Cipher.java:2244) at it.auties.whatsapp.crypto.SignalSession.decrypt(SignalSession.java:156) ... 13 more Aug 09, 2025 1:12:21 AM it.auties.whatsapp.api.WhatsappErrorHandler lambda$defaultErrorHandler$3 SEVERE: [381644836689] Socket failure at MESSAGE: Ignored failure java.util.NoSuchElementException: Missing session for MY PHONE NUMBER:36 2025-08-09 01:12:21 [] INFO rs.majic.ampere.Main - EMPTY at it.auties.whatsapp.crypto.SignalSession.lambda$decrypt$6(SignalSession.java:124) at java.base/java.util.Optional.orElseThrow(Optional.java:403) at it.auties.whatsapp.crypto.SignalSession.decrypt(SignalSession.java:124) at it.auties.whatsapp.socket.message.MessageComponent.decodeMessageBytes(MessageComponent.java:1133) at it.auties.whatsapp.socket.message.MessageComponent.decodeChatMessageContainer(MessageComponent.java:1065) at it.auties.whatsapp.socket.message.MessageComponent.decodeChatMessage(MessageComponent.java:1023) at it.auties.whatsapp.socket.message.MessageComponent.lambda$decode$28(MessageComponent.java:795) at java.base/java.lang.Iterable.forEach(Iterable.java:75) at it.auties.whatsapp.socket.message.MessageComponent.decode(MessageComponent.java:795) at it.auties.whatsapp.socket.SocketConnection.decodeMessage(SocketConnection.java:280) at it.auties.whatsapp.socket.stream.MessageHandler.execute(MessageHandler.java:13) at it.auties.whatsapp.socket.stream.NodeHandler$Executor.lambda$handle$0(NodeHandler.java:38) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.lang.VirtualThread.run(VirtualThread.java:329)

Onako2 avatar Aug 08 '25 22:08 Onako2

I am using Windows with Whatsapp personal and a Nokia 7.1 (Android 10) as the companion phone

Interesting, I've never seen an HmacValidationException there. What happens if you debug and just skip the check? Does it decrypt it then? I really doubt it but just to see

Aug 09, 2025 1:12:21 AM it.auties.whatsapp.api.WhatsappErrorHandler lambda$defaultErrorHandler$3 SEVERE: [NUMBER] Socket failure at MESSAGE: Ignored failure java.lang.IllegalArgumentException: Cannot decrypt data at it.auties.whatsapp.crypto.SignalSession.decrypt(SignalSession.java:160) at it.auties.whatsapp.crypto.SignalSession.decrypt(SignalSession.java:130) at it.auties.whatsapp.socket.message.MessageComponent.decodeMessageBytes(MessageComponent.java:1133) at it.auties.whatsapp.socket.message.MessageComponent.decodeChatMessageContainer(MessageComponent.java:1065) at it.auties.whatsapp.socket.message.MessageComponent.decodeChatMessage(MessageComponent.java:1023) at it.auties.whatsapp.socket.message.MessageComponent.lambda$decode$28(MessageComponent.java:795) at java.base/java.lang.Iterable.forEach(Iterable.java:75) at it.auties.whatsapp.socket.message.MessageComponent.decode(MessageComponent.java:795) at it.auties.whatsapp.socket.SocketConnection.decodeMessage(SocketConnection.java:280) at it.auties.whatsapp.socket.stream.MessageHandler.execute(MessageHandler.java:13) at it.auties.whatsapp.socket.stream.NodeHandler$Executor.lambda$handle$0(NodeHandler.java:38) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.lang.VirtualThread.run(VirtualThread.java:329) Caused by: javax.crypto.BadPaddingException: Given final block not properly padded. Such issues can arise if a bad key is used during decryption. at java.base/com.sun.crypto.provider.CipherCore.unpad(CipherCore.java:861) at java.base/com.sun.crypto.provider.CipherCore.fillOutputBuffer(CipherCore.java:941) at java.base/com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:734) at java.base/com.sun.crypto.provider.AESCipher.engineDoFinal(AESCipher.java:446) at java.base/javax.crypto.Cipher.doFinal(Cipher.java:2244) at it.auties.whatsapp.crypto.SignalSession.decrypt(SignalSession.java:156) ... 13 more Aug 09, 2025 1:12:21 AM it.auties.whatsapp.api.WhatsappErrorHandler lambda$defaultErrorHandler$3 SEVERE: [381644836689] Socket failure at MESSAGE: Ignored failure java.util.NoSuchElementException: Missing session for MY PHONE NUMBER:36 2025-08-09 01:12:21 [] INFO rs.majic.ampere.Main - EMPTY at it.auties.whatsapp.crypto.SignalSession.lambda$decrypt$6(SignalSession.java:124) at java.base/java.util.Optional.orElseThrow(Optional.java:403) at it.auties.whatsapp.crypto.SignalSession.decrypt(SignalSession.java:124) at it.auties.whatsapp.socket.message.MessageComponent.decodeMessageBytes(MessageComponent.java:1133) at it.auties.whatsapp.socket.message.MessageComponent.decodeChatMessageContainer(MessageComponent.java:1065) at it.auties.whatsapp.socket.message.MessageComponent.decodeChatMessage(MessageComponent.java:1023) at it.auties.whatsapp.socket.message.MessageComponent.lambda$decode$28(MessageComponent.java:795) at java.base/java.lang.Iterable.forEach(Iterable.java:75) at it.auties.whatsapp.socket.message.MessageComponent.decode(MessageComponent.java:795) at it.auties.whatsapp.socket.SocketConnection.decodeMessage(SocketConnection.java:280) at it.auties.whatsapp.socket.stream.MessageHandler.execute(MessageHandler.java:13) at it.auties.whatsapp.socket.stream.NodeHandler$Executor.lambda$handle$0(NodeHandler.java:38) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.lang.VirtualThread.run(VirtualThread.java:329)

Okay so it's actually undecipherable. I really wonder why this is happening

Auties00 avatar Aug 08 '25 22:08 Auties00

i too facing this issue. 1 ) SERVER_ACK response getting but not delvering the message to recipiant some times, if we register again then it is working for that day. i am trying with windows, qr scan login method.

  • this is happening in 0.0.10 version also,

in 0.1.0 master branch, also if we restart the application above scenario happening.

2 ) One more finding

Jid contactJid = Jid.of(message.getToMobileNumber()); Chat chat = null; try { if (message.isGroupMsg()) { chat = whatsappApi.store() .findChatByJid(contactJid) .filter(Chat::isGroup) .orElseThrow(() -> new RuntimeException(message.getToMobileNumber() + " chat not found or is not a group chat!")); } else { chat = whatsappApi.store() .findChatByJid(contactJid) .orElseThrow(() -> new RuntimeException(message.getToMobileNumber() + " chat not found!")); } } catch (RuntimeException e) { log.error("e = {}", String.valueOf(e)); }

var messageInfo = whatsappApi.sendChatMessage(chat != null ? chat : contactJid, message.getMessage());

even chat is available , findChatByJid(contactJid) returning null for contactjid.

NarayanaBoddu avatar Aug 13 '25 00:08 NarayanaBoddu

i too facing this issue. 1 ) SERVER_ACK response getting but not delvering the message to recipiant some times, if we register again then it is working for that day. i am trying with windows, qr scan login method.

  • this is happening in 0.0.10 version also,

in 0.1.0 master branch, also if we restart the application above scenario happening.

2 ) One more finding

Jid contactJid = Jid.of(message.getToMobileNumber()); Chat chat = null; try { if (message.isGroupMsg()) { chat = whatsappApi.store() .findChatByJid(contactJid) .filter(Chat::isGroup) .orElseThrow(() -> new RuntimeException(message.getToMobileNumber() + " chat not found or is not a group chat!")); } else { chat = whatsappApi.store() .findChatByJid(contactJid) .orElseThrow(() -> new RuntimeException(message.getToMobileNumber() + " chat not found!")); } } catch (RuntimeException e) { log.error("e = {}", String.valueOf(e)); }

var messageInfo = whatsappApi.sendChatMessage(chat != null ? chat : contactJid, message.getMessage());

even chat is available , findChatByJid(contactJid) returning null for contactjid.

Do you mind expanding better what happens in 0.1.0? Don't test using 0.0.10 please, use the latest commit in the master branch and try to be as specific as possible.

Auties00 avatar Aug 13 '25 16:08 Auties00