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 has been archived by the owner on Oct 23, 2023. It is now read-only.
I'm building a Dialogflow Agent, that needs to call a soap webservice to create a case in a CRM. However, when trying to fulfill the intent, and when I call the await for the webservice promise, it seems to trigger a second call for the same intent, with the same context and the case ends up created twice. (i.e. two successful calls to the webservice, and duplicated cases)
It seems to be a bug while managing promises?
My webhook looks something like this:
constCRMService=require('../services/crm/crm_soap');const{ Suggestions}=require('actions-on-google');const{ Suggestion }=require('dialogflow-fulfillment');module.exports=asyncfunction(agent){agent.requestSource=agent.ACTIONS_ON_GOOGLE;letconv=agent.conv();letuserContext=agent.context.get("usercontext");agent.context.set(userContext);if(userContext){//doing something with the context...
...
letcaseData={userID: 'xxxxxxx',email: '[email protected]',category: 'test'};try{letcrmResponse;//this line triggers a second parallel call to the intent.crmResponse=awaitCRMService.createCaseWebCallback(caseData);campusCode=CRMService.getCampusCode(crmResponse)console.log('campusCode: ',campusCode)}catch(error){console.log("id not found")}if(crmResponse['STATUS']==='1'){conv.ask(`${name}: `+', case created.');
...
and the service function looks something like this:
I'm building a Dialogflow Agent, that needs to call a soap webservice to create a case in a CRM. However, when trying to fulfill the intent, and when I call the await for the webservice promise, it seems to trigger a second call for the same intent, with the same context and the case ends up created twice. (i.e. two successful calls to the webservice, and duplicated cases)
It seems to be a bug while managing promises?
My webhook looks something like this:
and the service function looks something like this:
The text was updated successfully, but these errors were encountered: