Auties00 / Cobalt

Standalone unofficial fully-featured Whatsapp Web and Mobile API for Java and Kotlin
MIT License
664 stars 191 forks source link

Group with many participants disconnects the api #266

Closed Goddino-Repo closed 1 year ago

Goddino-Repo commented 1 year ago

Sono con la versione 3.3.1, utilizzo il vostro framework senza problemi, tranne in un caso... Facendo dei test in un gruppo con 3 partecipanti funziona regolarmente, quando però ho provato ad utilizzarlo su un gruppo con 210 partecipanti, qualunque messaggio provo ad inviare, si scollega senza mandare alcuna eccezione

aggiungendo un listener inline: .addDisconnectedListener(reason -> System.out.printf("Disconnected: %s%n", reason))

mi ritrovo solo questa informazione: Disconnected: DISCONNECTED

non ho provato con altri gruppi

Utilizzo il webBuilder

Goddino-Repo commented 1 year ago

con la build di maven ottengo il seguente output se può essere utile:

[WARNING] thread Thread[ForkJoinPool.commonPool-worker-1,5,com.config.Init] was interrupted but is still alive after waiting at least 15000msecs [WARNING] thread Thread[ForkJoinPool.commonPool-worker-1,5,com.config.Init] will linger despite being asked to die via interruption [WARNING] thread Thread[ForkJoinPool.commonPool-worker-2,5,com.config.Init] will linger despite being asked to die via interruption [WARNING] thread Thread[ForkJoinPool.commonPool-worker-3,5,com.config.Init] will linger despite being asked to die via interruption [WARNING] thread Thread[CompletableFutureDelayScheduler,5,com.config.Init] will linger despite being asked to die via interruption [WARNING] NOTE: 4 thread(s) did not finish despite being asked to via interruption. This is not a problem with exec:java, it is a problem with the running code. Although not serious, it should be remedied. [WARNING] Couldn't destroy threadgroup org.codehaus.mojo.exec.ExecJavaMojo$IsolatedThreadGroup[name=com.config.Init,maxpri=10] java.lang.IllegalThreadStateException at java.lang.ThreadGroup.destroy (ThreadGroup.java:803) at org.codehaus.mojo.exec.ExecJavaMojo.execute (ExecJavaMojo.java:321) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289) at org.apache.maven.cli.MavenCli.main (MavenCli.java:193) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:568) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 01:26 min [INFO] Finished at: 2023-04-27T17:29:45Z [INFO] ------------------------------------------------------------------------

Auties00 commented 1 year ago

hai un invito con un gruppo del genere cosi posso testare?

Goddino-Repo commented 1 year ago

hai un invito con un gruppo del genere cosi posso testare?

Ti giro il mio: https://chat.whatsapp.com/HfEaERNLIaJBSZUCMtHU8D

Goddino-Repo commented 1 year ago

@Auties00 ho provato a buildare dopo la tua ultima commit, ma mi restituisce un errore nella target directory C:\Users\Utente\Desktop\Whatsapp4j\target\generated-sources\annotations\it\auties\protobuf\ProtobufStubs.java:3:120937 java: incompatible types: invalid method reference incompatible types: java.util.Map cannot be converted to java.util.Collection<it.auties.whatsapp.model.chat.GroupParticipant>

Auties00 commented 1 year ago

prova di nuovo, dovrebbe essere risolto @Goddino-Repo

Goddino-Repo commented 1 year ago

@Auties00 vedo se ho qualcuno disponibile, nel caso provo sta sera e ti do un feed

Goddino-Repo commented 1 year ago

@Auties00 non è testabile, in fase di build mi da questo problema: https://github.com/Auties00/Whatsapp4j/issues/290 non riesco ad arrivarci si apre la connessione, caccia eccezione e si chiude il processo

Auties00 commented 1 year ago

@Auties00 non è testabile, in fase di build mi da questo problema: https://github.com/Auties00/Whatsapp4j/issues/290 non riesco ad arrivarci si apre la connessione, caccia eccezione e si chiude il processo

prova con la versione 3.4.1

Goddino-Repo commented 1 year ago

@Auties00 cambiato nulla

mag 24, 2023 12:44:22 PM it.auties.whatsapp.api.ErrorHandler lambda$defaultErrorHandler$1
SEVERE: Socket failure at UNKNOWN
java.io.UncheckedIOException: Cannot create link between store and phone number
    at it.auties.whatsapp.controller.DefaultControllerSerializer.linkPhoneNumber(DefaultControllerSerializer.java:264)
    at it.auties.whatsapp.controller.Controller.phoneNumber(Controller.java:98)
    at it.auties.whatsapp.socket.StreamHandler.saveCompanion(StreamHandler.java:851)
    at it.auties.whatsapp.socket.StreamHandler.confirmQrCode(StreamHandler.java:801)
    at it.auties.whatsapp.socket.StreamHandler.digestIq(StreamHandler.java:759)
    at it.auties.whatsapp.socket.StreamHandler.digest(StreamHandler.java:87)
    at it.auties.whatsapp.socket.SocketHandler.onMessage(SocketHandler.java:188)
    at it.auties.whatsapp.socket.SocketSession.readMessages(SocketSession.java:122)
    at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: java.nio.file.FileSystemException: C:\Users\Utente\.whatsapp4j\web\+39349*******: Il privilegio richiesto non appartiene al client
    at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:92)
    at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
    at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
    at java.base/sun.nio.fs.WindowsFileSystemProvider.createSymbolicLink(WindowsFileSystemProvider.java:598)
    at java.base/java.nio.file.Files.createSymbolicLink(Files.java:1069)
    at it.auties.whatsapp.controller.DefaultControllerSerializer.linkPhoneNumber(DefaultControllerSerializer.java:262)
    ... 13 more
mag 24, 2023 12:44:22 PM it.auties.whatsapp.api.ErrorHandler lambda$defaultErrorHandler$1
WARNING: Ignored failure
Connected
mag 24, 2023 12:44:23 PM com.config.Core onLoggedIn
INFO: Logged in!
mag 24, 2023 12:44:23 PM it.auties.whatsapp.api.ErrorHandler lambda$defaultErrorHandler$1
SEVERE: Socket failure at MESSAGE
java.util.concurrent.CompletionException: it.auties.protobuf.base.ProtobufSerializationException: Cannot invoke "Object.getClass()" because "object" is null
    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$UniApply.tryFire(CompletableFuture.java:649)
    at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: it.auties.protobuf.base.ProtobufSerializationException: Cannot invoke "Object.getClass()" because "object" is null
    at it.auties.whatsapp.util.Protobuf.writeMessage(Protobuf.java:22)
    at it.auties.whatsapp.socket.MessageHandler.createEncodedMessageNode(MessageHandler.java:201)
    at it.auties.whatsapp.socket.MessageHandler.lambda$encodeConversation$13(MessageHandler.java:166)
    at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)
    ... 6 more
Caused by: java.lang.NullPointerException: Cannot invoke "Object.getClass()" because "object" is null
    at it.auties.whatsapp.util.Protobuf.writeMessage(Protobuf.java:19)
    ... 9 more
mag 24, 2023 12:44:23 PM it.auties.whatsapp.api.ErrorHandler lambda$defaultErrorHandler$1
WARNING: Ignored failure
Disconnected: LOGGED_OUT

Process finished with exit code 0
Auties00 commented 1 year ago

@Auties00 cambiato nulla

mag 24, 2023 12:44:22 PM it.auties.whatsapp.api.ErrorHandler lambda$defaultErrorHandler$1
SEVERE: Socket failure at UNKNOWN
java.io.UncheckedIOException: Cannot create link between store and phone number
  at it.auties.whatsapp.controller.DefaultControllerSerializer.linkPhoneNumber(DefaultControllerSerializer.java:264)
  at it.auties.whatsapp.controller.Controller.phoneNumber(Controller.java:98)
  at it.auties.whatsapp.socket.StreamHandler.saveCompanion(StreamHandler.java:851)
  at it.auties.whatsapp.socket.StreamHandler.confirmQrCode(StreamHandler.java:801)
  at it.auties.whatsapp.socket.StreamHandler.digestIq(StreamHandler.java:759)
  at it.auties.whatsapp.socket.StreamHandler.digest(StreamHandler.java:87)
  at it.auties.whatsapp.socket.SocketHandler.onMessage(SocketHandler.java:188)
  at it.auties.whatsapp.socket.SocketSession.readMessages(SocketSession.java:122)
  at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
  at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
  at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
  at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
  at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
  at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: java.nio.file.FileSystemException: C:\Users\Utente\.whatsapp4j\web\+39349*******: Il privilegio richiesto non appartiene al client
  at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:92)
  at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
  at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
  at java.base/sun.nio.fs.WindowsFileSystemProvider.createSymbolicLink(WindowsFileSystemProvider.java:598)
  at java.base/java.nio.file.Files.createSymbolicLink(Files.java:1069)
  at it.auties.whatsapp.controller.DefaultControllerSerializer.linkPhoneNumber(DefaultControllerSerializer.java:262)
  ... 13 more
mag 24, 2023 12:44:22 PM it.auties.whatsapp.api.ErrorHandler lambda$defaultErrorHandler$1
WARNING: Ignored failure
Connected
mag 24, 2023 12:44:23 PM com.config.Core onLoggedIn
INFO: Logged in!
mag 24, 2023 12:44:23 PM it.auties.whatsapp.api.ErrorHandler lambda$defaultErrorHandler$1
SEVERE: Socket failure at MESSAGE
java.util.concurrent.CompletionException: it.auties.protobuf.base.ProtobufSerializationException: Cannot invoke "Object.getClass()" because "object" is null
  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$UniApply.tryFire(CompletableFuture.java:649)
  at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483)
  at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
  at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
  at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
  at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
  at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: it.auties.protobuf.base.ProtobufSerializationException: Cannot invoke "Object.getClass()" because "object" is null
  at it.auties.whatsapp.util.Protobuf.writeMessage(Protobuf.java:22)
  at it.auties.whatsapp.socket.MessageHandler.createEncodedMessageNode(MessageHandler.java:201)
  at it.auties.whatsapp.socket.MessageHandler.lambda$encodeConversation$13(MessageHandler.java:166)
  at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)
  ... 6 more
Caused by: java.lang.NullPointerException: Cannot invoke "Object.getClass()" because "object" is null
  at it.auties.whatsapp.util.Protobuf.writeMessage(Protobuf.java:19)
  ... 9 more
mag 24, 2023 12:44:23 PM it.auties.whatsapp.api.ErrorHandler lambda$defaultErrorHandler$1
WARNING: Ignored failure
Disconnected: LOGGED_OUT

Process finished with exit code 0

assicurati di aver cambiato versione e cancella le sessioni vecchie

Goddino-Repo commented 1 year ago

@Auties00 ti confermo che ho cambiato versione pom:

<dependency>
    <groupId>com.github.auties00</groupId>
    <artifactId>whatsappweb4j</artifactId>
    <version>3.4.1</version>
</dependency>

E che ho cancellato tutto il contenuto della directory .whatsapp4j In più ho utilizzato il builder con newConnection() per assicurarmi che non possano esserci stati problemi Ho compilato e si rompe con l'errore sopra citato

Goddino-Repo commented 1 year ago

@Auties00 come ti ho accennato su Discord, compilando come amministratore funziona Il problema è che se provo a far inviare un messaggio in un gruppo, mi tira eccezione

mag 24, 2023 7:08:02 PM it.auties.whatsapp.api.ErrorHandler lambda$defaultErrorHandler$1
SEVERE: Socket failure at MESSAGE
java.util.concurrent.CompletionException: java.lang.UnsupportedOperationException
    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$UniApply.tryFire(CompletableFuture.java:649)
    at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483)
    at java.base/java.util.concurrent.ForkJoinTask.doExec$$$capture(ForkJoinTask.java:373)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: java.lang.UnsupportedOperationException
    at java.base/java.util.concurrent.ConcurrentHashMap$ValuesView.addAll(ConcurrentHashMap.java:4747)
    at it.auties.whatsapp.socket.SocketHandler.handleGroupMetadata(SocketHandler.java:484)
    at it.auties.whatsapp.socket.SocketHandler.lambda$queryGroupMetadata$19(SocketHandler.java:472)
    at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)
    ... 7 more
mag 24, 2023 7:08:02 PM it.auties.whatsapp.api.ErrorHandler lambda$defaultErrorHandler$1
WARNING: Ignored failure
Auties00 commented 1 year ago

@Auties00 come ti ho accennato su Discord, compilando come amministratore funziona Il problema è che se provo a far inviare un messaggio in un gruppo, mi tira eccezione

mag 24, 2023 7:08:02 PM it.auties.whatsapp.api.ErrorHandler lambda$defaultErrorHandler$1
SEVERE: Socket failure at MESSAGE
java.util.concurrent.CompletionException: java.lang.UnsupportedOperationException
    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$UniApply.tryFire(CompletableFuture.java:649)
    at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483)
    at java.base/java.util.concurrent.ForkJoinTask.doExec$$$capture(ForkJoinTask.java:373)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: java.lang.UnsupportedOperationException
    at java.base/java.util.concurrent.ConcurrentHashMap$ValuesView.addAll(ConcurrentHashMap.java:4747)
    at it.auties.whatsapp.socket.SocketHandler.handleGroupMetadata(SocketHandler.java:484)
    at it.auties.whatsapp.socket.SocketHandler.lambda$queryGroupMetadata$19(SocketHandler.java:472)
    at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)
    ... 7 more
mag 24, 2023 7:08:02 PM it.auties.whatsapp.api.ErrorHandler lambda$defaultErrorHandler$1
WARNING: Ignored failure

usa il master

Goddino-Repo commented 1 year ago

@Auties00 con l'ultima commit il problema è stato risolto

Auties00 commented 1 year ago

@Auties00 con l'ultima commit il problema è stato risolto

benissimo