Auties00 / Cobalt

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

CustomSerializer not working on web #415

Closed vitorsbmendes closed 10 months ago

vitorsbmendes commented 10 months ago

Hey guys, I've implemented my own customserializer (WEB) for a mysql store and keys control, but after scanning the QRCode I always get the following error:

I means that I deserialize the store correctly, than deserialize the keys, then when the Controller tries to access linkMetadata, it throws a NullPointerException saying that the Serializer is null! What could it be??

Call to deserializeStore with ClientType: WEB and UUID: 7e352762-1bd8-4e00-9acf-519b905d112f

Instance ID: 7e352762-1bd8-4e00-9acf-519b905d112f Call to deserializeKeys with ClientType: WEB and UUID: 7e352762-1bd8-4e00-9acf-519b905d112f Instance ID: 7e352762-1bd8-4e00-9acf-519b905d112f 2023-11-16 16:30:42.465 ERROR 1 --- [onPool-worker-2] ErrorHandler : Socket failure at UNKNOWN   |   | 2023-11-16T16:30:42.466139321Z stderr F java.lang.NullPointerException: Cannot invoke "it.auties.whatsapp.controller.ControllerSerializer.linkMetadata(it.auties.whatsapp.controller.Controller)" because "this.serializer" is null at it.auties.whatsapp.controller.Controller.phoneNumber(Controller.java:105) at it.auties.whatsapp.socket.StreamHandler.saveCompanion(StreamHandler.java:1061) at it.auties.whatsapp.socket.StreamHandler.confirmQrCode(StreamHandler.java:1009) at it.auties.whatsapp.socket.StreamHandler.digestIq(StreamHandler.java:911) at it.auties.whatsapp.socket.StreamHandler.digest(StreamHandler.java:101) at it.auties.whatsapp.socket.SocketHandler.onMessage(SocketHandler.java:206) at it.auties.whatsapp.socket.SocketSession.readMessages(SocketSession.java:123) at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(Unknown Source) at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source) at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source) at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) 2023-11-16 16:30:42.466 WARN 1 --- [onPool-worker-2] ErrorHandler : Ignored failure Instance is logged in

vitorsbmendes commented 10 months ago

Spring is probably killing the @Service. I changed the idea for the controller and apparently it worked!

Sorry for opening this!