Not saving WSJT-X QSOs
xylo04 opened this issue · 0 comments
xylo04 commented
Right now, Kellog is not saving logged QSOs sent by kel-agent.
Turns out, that's because kel-agent is serializing multiple JSON documents in a single websocket message:
{"version":"kel-agent v0.2.2 (f03f44e)","wsjtx":{"type":"QsoLoggedMessage","payload":{"id":"WSJT-X","dateTimeOff":"2021-01-03T00:43:45Z","dxCall":"K6ESE","dxGrid":"EL09","txFrequency":7076100,"mode":"FT8","reportSent":"-15","reportReceived":"-07","txPower":"100","comments":"","name":"","dateTimeOn":"2021-01-03T00:42:45Z","operatorCall":"","myCall":"K0SWE","myGrid":"DM79LV","exchangeSent":"","exchangeReceived":""}}}
{"version":"kel-agent v0.2.2 (f03f44e)","wsjtx":{"type":"LoggedAdifMessage","payload":{"id":"WSJT-X","adif":"\n\u003cadif_ver:5\u003e3.1.0\n\u003cprogramid:6\u003eWSJT-X\n\u003cEOH\u003e\n\u003ccall:5\u003eK6ESE \u003cgridsquare:4\u003eEL09 \u003cmode:3\u003eFT8 \u003crst_sent:3\u003e-15 \u003crst_rcvd:3\u003e-07 \u003cqso_date:8\u003e20210103 \u003ctime_on:6\u003e004245 \u003cqso_date_off:8\u003e20210103 \u003ctime_off:6\u003e004345 \u003cband:3\u003e40m \u003cfreq:8\u003e7.076100 \u003cstation_callsign:5\u003eK0SWE \u003cmy_gridsquare:6\u003eDM79LV \u003ctx_pwr:3\u003e100 \u003cEOR\u003e"}}}
SyntaxError: Unexpected token { in JSON at position 419
at JSON.parse (<anonymous>)
...
The correct behavior is probably for kel-agent to send only one JSON document per websocket message. As a workaround, Kellog can split on line separators.