yetibot / core

:expressionless: Core yetibot utilities, extracted for shared use among Yetibot and its various plugins
https://yetibot.com
Eclipse Public License 1.0
27 stars 17 forks source link

history command with extra args fails #197

Closed gkspranger closed 2 years ago

gkspranger commented 3 years ago

!history works AOK .. !history | tail 2 fails with exception (see below)

best i can tell, this was working for clojar 20190910.175122.9e253dd, started throwing exceptions in 20190913.182757.1838a79, and has maintained that exception since then

tried to drill down what change/PR may have occurred during that time -- but there appears to be a gap between a PR being closed and the noted clojars being created

image

long of the short is, (clojure.string/split) is being passed a vector from the (yetibot.core.commands.history/split-cmd) function, and that vector looks like this :: [:cmd [:words "count"]]

not entirely sure why or what changed for it to start passing vectors vs strings

not urgent, just adding for posterity

exception

21-07-07 15:31:28 UnknownHost INFO [yetibot.core.commands.history:130] - history-cmd match ""
21-07-07 15:31:28 UnknownHost ERROR [yetibot.core.handler:176] - error handling expression: !history | count
java.lang.ClassCastException: class clojure.lang.PersistentVector cannot be cast to class java.lang.CharSequence (clojure.lang.PersistentVector is in unnamed module of loader 'app'; java.lang.CharSequence is in module java.base of loader 'bootstrap')
 at clojure.string$split.invokeStatic (string.clj:219)
    clojure.string$split.invoke (string.clj:219)
    yetibot.core.commands.history$split_cmd.invokeStatic (history.clj:14)
    yetibot.core.commands.history$split_cmd.invoke (history.clj:14)
    yetibot.core.commands.history$should_consume_cmd_QMARK_.invokeStatic (history.clj:17)
    yetibot.core.commands.history$should_consume_cmd_QMARK_.invoke (history.clj:16)
    clojure.core$take_while$fn__5936.invoke (core.clj:2910)
    clojure.lang.LazySeq.sval (LazySeq.java:42)
    clojure.lang.LazySeq.seq (LazySeq.java:51)
    clojure.lang.RT.seq (RT.java:535)
    clojure.lang.RT.countFrom (RT.java:650)
    clojure.lang.RT.count (RT.java:643)
    yetibot.core.commands.history$history_cmd.invokeStatic (history.clj:145)
    yetibot.core.commands.history$history_cmd.invoke (history.clj:55)
    clojure.lang.Var.invoke (Var.java:384)
    yetibot.core.hooks$handle_with_hooked_cmds.invokeStatic (hooks.clj:94)
    yetibot.core.hooks$handle_with_hooked_cmds.invoke (hooks.clj:65)
    clojure.lang.AFn.applyToHelper (AFn.java:160)
    clojure.lang.AFn.applyTo (AFn.java:144)
    clojure.lang.Var.applyTo (Var.java:705)
    clojure.core$apply.invokeStatic (core.clj:669)
    clojure.core$apply.invoke (core.clj:662)
    robert.hooke$compose_hooks$fn__12279.doInvoke (hooke.clj:40)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invokeStatic (core.clj:667)
    clojure.core$apply.invoke (core.clj:662)
    robert.hooke$run_hooks.invokeStatic (hooke.clj:46)
    robert.hooke$run_hooks.invoke (hooke.clj:45)
    robert.hooke$prepare_for_hooks$fn__12284$fn__12285.doInvoke (hooke.clj:54)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.lang.AFunction$1.doInvoke (AFunction.java:31)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invokeStatic (core.clj:667)
    clojure.core$apply.invoke (core.clj:662)
    yetibot.core.interpreter$pipe_cmds.invokeStatic (interpreter.clj:85)
    yetibot.core.interpreter$pipe_cmds.invoke (interpreter.clj:41)
    clojure.lang.Var.invoke (Var.java:393)
    clojure.core$partial$fn__5858.invoke (core.clj:2629)
    clojure.core.protocols$fn__8183.invokeStatic (protocols.clj:168)
    clojure.core.protocols/fn (protocols.clj:124)
    clojure.core.protocols$fn__8138$G__8133__8147.invoke (protocols.clj:19)
    clojure.core.protocols$seq_reduce.invokeStatic (protocols.clj:31)
    clojure.core.protocols$fn__8170.invokeStatic (protocols.clj:75)
    clojure.core.protocols/fn (protocols.clj:75)
    clojure.core.protocols$fn__8112$G__8107__8125.invoke (protocols.clj:13)
    clojure.core$reduce.invokeStatic (core.clj:6833)
    clojure.core$reduce.invoke (core.clj:6815)
    yetibot.core.interpreter$handle_expr.invokeStatic (interpreter.clj:158)
    yetibot.core.interpreter$handle_expr.invoke (interpreter.clj:141)
    yetibot.core.parser$transformer.invokeStatic (parser.clj:53)
devth commented 3 years ago

@gkspranger thanks for reporting! By the way, the last segment of the version is the commit sha, so the release that possibly broke it corresponds with https://github.com/yetibot/core/commit/1838a79.