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
{{ message }}
This repository was archived by the owner on Dec 29, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 29, 2022. It is now read-only.
Can't send group of messages using sendMessageSet #27
// figure out version this.chatbaseUserMessage.setVersion(chatbaseVersion);this.chatbaseChatbotMessage.setVersion(chatbaseVersion);// Send statistics to chatbasethis.chatbaseMessageGroup.sendMessageSet().then(set=>{logger.info(set.getCreateResponse());}).catch(err=>{logger.error(err);});
But I get the following anyway:
server 2019-01-06T21:18:18.782Z [Chatbot] error: One or more required fields were not set on the message, please check the documentation on how to set the following message fields:
server api_key, type, user_id, time_stamp, platform, message
Even if I provide a proper version at the beginning, same result.
It is really not nice to have the same debug message at every try, you should consider improving the debugging DX here and let us know what's wrong exactly. It's a waste of time for everyone who tries to use this tool.
I figured it out by debugging the code:
Added a console.error to pinpoint the erroring message at MessageSet.js
staticextractPayloadsFromMessageSet(messages){varmessagePayloadSet=[];for(vari=0;i<messages.length;i++){messagePayloadSet.push(messages[i].exportCreatePayload());if(last(messagePayloadSet)instanceofError){console.error('--err messages[i]',messages[i])// return the errorreturnlast(messagePayloadSet);}}returnmessagePayloadSet;}
The check that is done is basically checking that all those fields are strings: const MSG_UPDATE_EXPORT_KEYS = ['api_key', 'message_id', 'intent', 'feedback', 'version'];
In my case, the message field was null in the message that was the agent response.
Activity
Vadorequest commentedon Jan 6, 2019
I figured it out by debugging the code:
Added a console.error to pinpoint the erroring message at MessageSet.js
The check that is done is basically checking that all those fields are strings:
const MSG_UPDATE_EXPORT_KEYS = ['api_key', 'message_id', 'intent', 'feedback', 'version'];In my case, the
messagefield was null in the message that was the agent response.