Encryption/Decryption issues related to messages megathread
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.
Any idea what’s causing this?
Note: Web API
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):
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.
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
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.
i too face this issue
my observations
- Register wa by QR Login method.
- security keys for chats are sync to .cobal folder
- 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"
- 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.
i too face this issue
my observations
- Register wa by QR Login method.
- security keys for chats are sync to .cobal folder
- 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"
- 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?
I can confirm that this is still happening in 0.0.10
Can also confirm not working in 0.0.10
Can also confirm not working in 0.0.10
![]()
do you mind cloning the master branch and trying again? use a new session
Can also confirm not working in 0.0.10
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 :)
THANKS! Seems to work now.
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
~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
~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.
~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
idk. if this is related to the issue.
idk. if this is related to the issue.
so just the first message doesn't arrive? the others do?
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)?
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?
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
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
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)
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
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
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);
}
}
}
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
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?
I am using Windows with Whatsapp personal and a Nokia 7.1 (Android 10) as the companion phone
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
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)
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
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.
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.
idk. if this is related to the issue.
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)
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