@Dinesh Rajagoni (Tata Consultancy Services Limi) The code you shared works perfectly fine in my local. However, when I try to use it in the cloud I get this error in the console when sending the new Activity.
[onTurnError] unhandled error TypeError: Cannot read properties of undefined (reading 'statusCode')at TeamsBot.<anonymous> (C:\home\site\wwwroot\node_modules\botbuilder-core\lib\activityHandler.js:509:51)at Generator.next (<anonymous>)at fulfilled (C:\home\site\wwwroot\node_modules\botbuilder-core\lib\activityHandler.js:9:58)at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
I tried adding the statusCode in the sendAdtivity
and in the `invokeResponse`
but neither worked.
invokeResponse = InvokeResponseFactory.adaptiveCard(successInteractionStatusChange);
invokeResponse.statusCode = StatusCodes.OK;
console.info("Llegamos al response ", invokeResponse);
await context.sendActivity({
type: ActivityTypes.InvokeResponse,
value: invokeResponse,
statusCode: StatusCodes.OK,
});
I also tried this:
let message = MessageFactory.attachment(CardFactory.adaptiveCard(successInteractionStatusChange))
message.id = context.activity.replyToId;
// Update the activity
await context.updateActivity(message);
the story is the same, works locally, but when in the cloud I get this new error:
Error occurred in the invoke: RestError: Uncategorized sanitization library exception Object reference not set to an instance of an object.{"name": "RestError","code": "BadSyntax","statusCode": 400,"request": {"streamResponseStatusCodes": {},"url": "[REDACTED]","method": "PUT","headers": {"_headersMap": {"content-type": "application/json; charset=utf-8","accept": "/","user-agent": "[REDACTED]","authorization": "[REDACTED]"}},"withCredentials": false,"timeout": 0,"requestId": "[REDACTED]"},"details": {"error": {"code": "BadSyntax","message": "Uncategorized sanitization library exception Object reference not set to an instance of an object."}},"message": "Uncategorized sanitization library exception Object reference not set to an instance of an object."}[onTurnError] unhandled error TypeError: Cannot read properties of undefined (reading 'statusCode') at TeamsBot.<anonymous> (C:\home\site\wwwroot\node_modules\botbuilder-core\lib\activityHandler.js:509:51) at Generator.next (<anonymous>) at fulfilled (C:\home\site\wwwroot\node_modules\botbuilder-core\lib\activityHandler.js:9:58) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)