Cobalt icon indicating copy to clipboard operation
Cobalt copied to clipboard

Unable to send messages to group contacts

Open GDB4J opened this issue 3 months ago • 3 comments

Hi,

I couldn't find my past issue anymore, perhaps accidentally removed/archived So posting it again, below:

Since Thursday September 4, 2025, i'm unable to send messages to group contacts. However i'm still able to send messages to a single / regular contact.

The code i'm using to send a message:

var chat = api.store()
    .findChatByName(message.getReceiver().name)
    .orElseThrow(() -> new NoSuchElementException("Chat does not exist!"));
ContextualMessage whatsAppMessage = null;
var testMessageBuilder = new TextMessageBuilder() // Create a new text message
    .text(message.getText());
whatsAppMessage = testMessageBuilder.build();
api.sendMessage(chat, whatsAppMessage);

When i'm using version of cobalt 0.0.9, i'm getting this stacktrace / timeout: And using this version of web api.store().setDevice(CompanionDevice.web(Version.of("2.3000.1023231279")));

2025-09-08T09:17:52,147 ERROR [ForkJoinPool.commonPool-worker-11] WhatsappErrorHandler: WhatsApp Error: 'it.auties.whatsapp.exception.RequestException: Node timed out: Node[description=iq, attributes={xmlns=usync, to=s.whatsapp.net, type=get, id=442cf7e9308e}, content=[Node[description=usync, attributes={last=true, sid=1757315812-7934395194-763, mode=query, index=0, context=message}, content=[Node[description=query, content=[Node[description=devices, attributes={version=2}]]], Node[description=list, content=[Node[description=user, attributes={jid=[email protected]}], Node[description=user, attributes={jid=[email protected]}], Node[description=user, attributes={jid=[email protected]}]]]]]]]' 2025-09-08T09:17:52,147 ERROR [ForkJoinPool.commonPool-worker-11] WhatsappErrorHandler: Stacktrace: java.util.concurrent.CompletionException: it.auties.whatsapp.exception.RequestException: Node timed out: Node[description=iq, attributes={xmlns=usync, to=s.whatsapp.net, type=get, id=442cf7e9308e}, content=[Node[description=usync, attributes={last=true, sid=1757315812-7934395194-763, mode=query, index=0, context=message}, content=[Node[description=query, content=[Node[description=devices, attributes={version=2}]]], Node[description=list, content=[Node[description=user, attributes={jid=[email protected]}], Node[description=user, attributes={jid=[email protected]}], Node[description=user, attributes={jid=[email protected]}]]]]]]] at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) at java.base/java.util.concurrent.CompletableFuture.uniExceptionally(CompletableFuture.java:994) at java.base/java.util.concurrent.CompletableFuture$UniExceptionally.tryFire(CompletableFuture.java:974) at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510) at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2194) at java.base/java.util.concurrent.CompletableFuture$Timeout.run(CompletableFuture.java:2920) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) at java.base/java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:317) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java) at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) 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.Thread.run(Thread.java:1583) Caused by: it.auties.whatsapp.exception.RequestException: Node timed out: Node[description=iq, attributes={xmlns=usync, to=s.whatsapp.net, type=get, id=442cf7e9308e}, content=[Node[description=usync, attributes={last=true, sid=1757315812-7934395194-763, mode=query, index=0, context=message}, content=[Node[description=query, content=[Node[description=devices, attributes={version=2}]]], Node[description=list, content=[Node[description=user, attributes={jid=[email protected]}], Node[description=user, attributes={jid=[email protected]}], Node[description=user, attributes={jid=[email protected]}]]]]]]] at it.auties.whatsapp.implementation.SocketRequest.lambda$futureOrTimeout$0(SocketRequest.java:24) at java.base/java.util.concurrent.CompletableFuture.uniExceptionally(CompletableFuture.java:990) ... 11 common frames omitted

When i'm using the latest version of cobalt 0.0.10, i'm getting this stacktrace: (no web version specified)

2025-09-08T09:04:15,269 ERROR [ForkJoinPool.commonPool-worker-4] WhatsappErrorHandler: WhatsApp Error: 'java.lang.InternalError' 2025-09-08T09:04:15,269 ERROR [ForkJoinPool.commonPool-worker-4] WhatsappErrorHandler: Stacktrace: java.util.concurrent.CompletionException: java.lang.InternalError at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1159) at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483) at java.base/java.util.concurrent.ForkJoinTask.doExec$$$capture(ForkJoinTask.java:387) at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312) at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843) at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188) Caused by: java.lang.InternalError: null at it.auties.whatsapp.model.signal.message.SenderKeyMessage.serialized(SenderKeyMessage.java:57) at it.auties.whatsapp.crypto.GroupCipher.encrypt(GroupCipher.java:44) at it.auties.whatsapp.socket.MessageHandler.encodeGroup(MessageHandler.java:471) at it.auties.whatsapp.socket.MessageHandler.lambda$encodeChatMessage$0(MessageHandler.java:118) at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1150) ... 7 common frames omitted

When i'm debugging to the SenderKeyMessage.serialized method, i see this is caused by the piece of code: signature.length != SIGNATURE_LENGTH 32 vs 64

Image

@Auties00 @t-aautiero Could this been a bug?

I'm using java 21, Spring boot version 3.5.0 I'm still able to send messages to the groups when using https://web.whatsapp.com/

Anyone can help me out on this?

GDB4J avatar Sep 24 '25 16:09 GDB4J

use the master branch

Auties00 avatar Sep 29 '25 21:09 Auties00

use the master branch

Currently not able to build the master branch

  • Cannot find it.auties.whatsapp.model.signal.message.SenderKeyDistributionMessageBuilder, it.auties.whatsapp.model.signal.group.ratchet.SenderChainKeyBuilder, ...

Also noted, you've upgraded it to java 24 Commit https://github.com/Auties00/Cobalt/commit/dbe81c8fb41939bffb3a715bc14866640a6ca430#diff-9c5fb3d1b7e3b0f54bc5c4182965c4fe1f9023d449017cece3005d3f90e8e4d8R173

So, it's no longer compatible with java 21?

GDB4J avatar Oct 01 '25 07:10 GDB4J

use the master branch

Currently not able to build the master branch

* Cannot find `it.auties.whatsapp.model.signal.message.SenderKeyDistributionMessageBuilder`, `it.auties.whatsapp.model.signal.group.ratchet.SenderChainKeyBuilder`, ...

Also noted, you've upgraded it to java 24 Commit dbe81c8#diff-9c5fb3d1b7e3b0f54bc5c4182965c4fe1f9023d449017cece3005d3f90e8e4d8R173

So, it's no longer compatible with java 21?

it will require java 25, i'll try to have the master branch ready as soon as possible. most changes are already there

Auties00 avatar Oct 07 '25 13:10 Auties00