Uploaded image for project: ' AGL Development'
  1. AGL Development
  2. SPEC-2764 Integrate Alexa with properly with Halibut / Icefish
  3. SPEC-3084

alexa-voiceagent-service and vshl-core bindings sending incorrect event JSON

XMLWordPrintable

      While trying to use events from vshl-capabilities it was discovered that the event argument json-c object does not parse as expected, and the issue affects all events coming from both alexa-voiceagent-service and agl-service-voice-high.  The problems stem from misuse of the json-c API.

      In alexa-voiceagent-service, strings containing JSON document fragments are put whole into a json-c string object which is added to the event argument object, rather than being added as built up json-c object hierarchies. The result is an embedded JSON document in a string with extra escaping, and is not usable on the receiver without knowing that part of the event object effectively needs to be run through a JSON parser to be usable.

      In agl-service-voice-high / vshl-core, forwarded capabilities events from the voiceagent similarly have their contents as a whole stuck into a json-c string object which is used as the event argument. The effect is the whole JSON document is quoted and unusable until run through a JSON parser.  In combination with the voiceagent issue, getting the event contents out can take some doing, as it takes either a very forgiving JSON parser or multiple parses.  This is contrary to the documentation, which shows simple JSON being returned for events, with the implication that it will be usable directly with the json-c API.  There have been some workarounds done in homescreen and for some events in libqtappfw, but now that the root cause is understood, this realistically has to be fixed to have any chance of straightforwardly using the more complicated capabilities events.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            scottm Scott Murray
            scottm Scott Murray
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: