Katrix / AckCord

A Discord library for Scala using Akka
https://ackcord.katsstuff.net/
MIT License
113 stars 15 forks source link

RawChannel has no entry in CacheTypeRegistry #72

Closed Yomanz closed 2 years ago

Yomanz commented 2 years ago
18:05:21.518 [AckCord-akka.actor.default-dispatcher-14] DEBUG a.cachehandlers.CacheTypeRegistry - updater not found
java.lang.Exception: No updater found for class ackcord.data.raw.RawChannel
at ackcord.cachehandlers.CacheTypeRegistry.getWithData(CacheTypeRegistry.scala:64)
at ackcord.cachehandlers.CacheTypeRegistry.handleWithData(CacheTypeRegistry.scala:46)
at ackcord.cachehandlers.CacheTypeRegistry.updateData(CacheTypeRegistry.scala:49)
at ackcord.cachehandlers.CacheHandlers$$anon$22.$anonfun$handle$202(CacheHandlers.scala:662)
at ackcord.cachehandlers.CacheHandlers$$anon$22.$anonfun$handle$202$adapted(CacheHandlers.scala:662)
at ackcord.util.JsonSome.foreach(JsonOption.scala:100)
at ackcord.cachehandlers.CacheHandlers$$anon$22.handle(CacheHandlers.scala:662)
at ackcord.cachehandlers.CacheHandlers$$anon$22.handle(CacheHandlers.scala:574)
at ackcord.APIMessageCacheUpdate.process(cacheUpdates.scala:68)
at ackcord.CacheStreams$.$anonfun$cacheUpdater$2(CacheStreams.scala:254)
at akka.stream.impl.fusing.StatefulMapConcat$$anon$49.onPush(Ops.scala:2238)
at akka.stream.impl.fusing.GraphInterpreter.processPush(GraphInterpreter.scala:542)
at akka.stream.impl.fusing.GraphInterpreter.processEvent(GraphInterpreter.scala:496)
at akka.stream.impl.fusing.GraphInterpreter.execute(GraphInterpreter.scala:390)
at akka.stream.impl.fusing.GraphInterpreterShell.runBatch(ActorGraphInterpreter.scala:650)
at akka.stream.impl.fusing.GraphInterpreterShell$AsyncInput.execute(ActorGraphInterpreter.scala:521)
at akka.stream.impl.fusing.GraphInterpreterShell.processEvent(ActorGraphInterpreter.scala:625)
at akka.stream.impl.fusing.ActorGraphInterpreter.akka$stream$impl$fusing$ActorGraphInterpreter$$processEvent(ActorGraphInterpreter.scala:800)
at akka.stream.impl.fusing.ActorGraphInterpreter$$anonfun$receive$1.applyOrElse(ActorGraphInterpreter.scala:818)
at akka.actor.Actor.aroundReceive(Actor.scala:537)
at akka.actor.Actor.aroundReceive$(Actor.scala:535)
at akka.stream.impl.fusing.ActorGraphInterpreter.aroundReceive(ActorGraphInterpreter.scala:716)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:580)
at akka.actor.ActorCell.invoke(ActorCell.scala:548)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:270)
at akka.dispatch.Mailbox.run(Mailbox.scala:231)
at akka.dispatch.Mailbox.exec(Mailbox.scala:243)
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)

I think it's because discord have added a new Channel type causing a RawChannel to get through.

It can be fixed by adding classOf[RawChannel] -> CacheUpdater.dummy[RawChannel](shouldBeIgnored = true) and classOf[RawChannel] -> CacheDeleter.dummy[RawChannel](shouldBeIgnored = true) to your own CacheTypeRegistry when creating Events.