You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I somehow ended up with a string with a weird space in it.
it looked like this:
"Please press a rune below to give your answer."
which looked pretty normal in my editor, but there was a special kind of line break character after the word rune, which I believe was the one linked below.
When the JSON gets sent to keybase chat send, the line break is messing up the JSON on the go side.
I've seen this as well, but with pretty quotes (unicode 2018 and 2019). It seems like any escaped unicode character passed to Keybase chat send causes the message to fail, eg:
(node:8370) UnhandledPromiseRejectionWarning: Error: 2019-07-02T18:24:22.160130Z ▶️ [ERRO keybase main.go:86] 001 invalid JSON: expected more JSON in input
at ChildProcess.child.on.code (/home/ubuntu/keybase-bot-master/index.js:214:16)
at ChildProcess.emit (events.js:193:13)
at maybeClose (internal/child_process.js:1001:16)
at Process.ChildProcess.handle.onexit (internal/childprocess.js:266:5)
The json for the send parameter is valid. I ran it through validators and even a golang playground which processed it OK, but it does have stuff like this:
\nSaving to: \u2018mpir-3.0.0.tar.bz2\u2019\n
Removing all \u entries lets things work. I am guessing the Keybase json parser is getting confused over the length of the message (it isn't counting the escaped unicode value correctly) and that results in the "expected more JSON in input" error since the length is shorter after being unescaped? But that is just a guess, I stopped debugging once I found the workaround.
func (c *cmdAPI) decode(ctx context.Context, r io.Reader, w io.Writer, h handler) error {
dec := json.NewDecoder(r)
for {
var c Call
if err := dec.Decode(&c); err == io.EOF {
break
} else if err != nil {
if err == io.ErrUnexpectedEOF {
return ErrInvalidJSON{message: "expected more JSON in input"}
}
return err
I somehow ended up with a string with a weird space in it.
it looked like this:
which looked pretty normal in my editor, but there was a special kind of line break character after the word rune, which I believe was the one linked below.
When the JSON gets sent to keybase chat send, the line break is messing up the JSON on the go side.
http://www.fileformat.info/info/unicode/char/00a0/index.htm
The text was updated successfully, but these errors were encountered: