Welcome to the Bot Framework SDK for JavaScript repository, which is the home for the libraries and packages that enable developers to build sophisticated bot applications using JavaScript.
botbuilder 4.3.0
botbuilder-azure 4.3.4
nodejs version v10.14.2
Windows 10 pro v1803
Describe the bug
When performing a delete operation in a partitioned cosmosDB collection, the following error is thrown:
“{
“code”:“BadRequest”,
“message”: “PartitionKey value must be supplied for this operation.\r\nActivityId:b46cf62e-d77f-4911-97d4-b8e86186a348,
\r\nRequestStartTime:2019-03 -27 T20:17:05.5558598 Z,
RequestEndTime:2019-03 -27 T20:17:05.5558598 Z,
Number of regions attempted:1 \r\n,
Microsoft.Azure.Documents.Common/2.2.0.0”
}”
To Reproduce
Steps to reproduce the behavior:
Install the AzureCosmoDb emulator
Create a partitioned collection and insert a new document (Sample image below)
2.1 Use the following information to create a new Cosmos Database in the emulator:
Update the code to attempt to delete the document
5.1 Insert the next code in the onTurn method of the echoBot class
const storage = new CosmosDbStorage(getSettings(), policyConfigurator);
if (turnContext.activity.type === ActivityTypes.Message) {
try {
await storage.delete([turnContext.activity.text]);
} catch (ex) {
await turnContext.sendActivity(`Error message when trying to delete in cosmos DB storage`);
await turnContext.sendActivity(`"${ex.body}"`);
}
} else {
// Generic handler for all other activity types.
await turnContext.sendActivity(`insert the document id to delete`);
}
// Save state changes
await this.conversationState.saveChanges(turnContext);
}
Run the bot.
Insert the document id of the document created before. (sample imagen below)
Expected behavior
Delete the document successfully
Screenshots
The partitioned collection
After, the following result was found:
Versions
botbuilder 4.3.0 botbuilder-azure 4.3.4 nodejs version v10.14.2 Windows 10 pro v1803
Describe the bug
When performing a delete operation in a partitioned cosmosDB collection, the following error is thrown:
To Reproduce
Steps to reproduce the behavior:
Install the AzureCosmoDb emulator
Create a partitioned collection and insert a new document (Sample image below)
2.1 Use the following information to create a new Cosmos Database in the emulator:
2.2 Add a new document using the following information
Use the echobot-with-counter
Connect the bot with the CosmosDb created
Update the code to attempt to delete the document 5.1 Insert the next code in the onTurn method of the echoBot class
Run the bot.
Expected behavior
Delete the document successfully
Screenshots
The partitioned collection After, the following result was found: