cloud-sdk-js: Batch DELETE throws batch-response-parser error

Hello,

I am doing a batch request which contains DELETE requests for PurchaseOrderItems using the following code:

public async deletePurchaseOrderItems(purchaseOrderId: string, purchaseOrderItemIds: string[]): Promise<void> {
    try {
        const deleteRequests = purchaseOrderItemIds.map(poi =>
            PurchaseOrderItem.requestBuilder().delete(purchaseOrderId, poi)
        )
        // Execute the batch request
        await batch(changeset(...deleteRequests)).execute(Constants.DESTINATION);
        this.logger.debug(`Purchase Order ${purchaseOrderId} items deleted`);
    } catch (err) {
        this.logger.debug(err);
    }
}

The request does what I need, which is to mark for deletion the items in the Purchase Order, but the logs show an error: image

Could you please help me figure out where is the error coming from an how to handle it?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (8 by maintainers)

Most upvoted comments

@tomfrenken @jjtang1985 ,

Thanks so much for the support with the issue! Just got around to test it and it works, sorry for the delay 😃

Hi @stefania-santimbrean , we released a new version 1.40.0 this morning. I’ll close the ticket. Please feel free to reopen or comment in case you have further questions.

By the way, we release a canary version to npm for every commit, which means actually you could already test the canary version when the PR was merged.

Hey @stefania-santimbrean, we have resolved the issue and it should be available to you in the next release, please let us now if the issue was solved for you.

Hi @stefania-santimbrean ,

I’ll share this information with the team and will let you know once there are some updates.

Best regards, Junjie

Hi @stefania-santimbrean, Thank you for your raw response example.

I can reproduce your error by using the example provided. This is a bug from the SDK and we will work on it.

Please correct me. From my understanding, the batch request is executed without any issues, meaning the delete operations are successfully applied. The response object looks also fine, since 204 should not return any real data as body. The issue is about the false-positive error message.

Best regards, Junjie