Closed bosh closed 2 hours ago
I'm not sure but if you use quotes or represent that character in a different encoding work?
Good find! I wasn't expecting any question marks in strings, so the separation of the BCP message was minimal. I've added a change to restrict the message parsing to only one question mark, so any question marks in the JSON body will be part of their strings.
This isn't a perfect solution if there were to be a non-JSON payload that had a question mark, but I can't think of a scenario where that would be the case so I think it should be fine for now.
This fix is available in the latest main
branch.
Just verified the fix removes the crash. Thanks!
Oh I just realized this should have been an issue in that repo, not mpf main. My bad :)
I've been running into weird behavior and a json message sent to the gmc bcp parser that causes it to hurl, but I've figured out how to avoid the issue for now. TLDR is I had a '?' in a settings item label which caused an unexpected line split in bcp parser.I was seeing the error:
due to truncated settings json (variable "message').The split on "?" on bcp_parse:13 resulted in split_message[1] being the invalid json body:
My settings.yaml is defined as:
Tracing back up I found that split_message[2] exists with value:
So it looks like ? in label text leads to no fun.It seems reasonable that a user might use a ? in one of these strings, but for now I'm just dropping the character from my text. I'm happy to implement a fix or add some robustness, if we do want to support the ?.
Options seem to be:
Thoughts?