commercetools / commercetools/sphere-node-sdk
Handle API update actions limit per request
- Dominant language
- CoffeeScript
- Stars
- 16
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
### Expected behavior
SDK would process update actions in batches if total amount of actions is bigger than 500
### Actual behavior
It would POST all actions and run into API error (see below)
### Steps to reproduce the behavior
Create more than 500 update actions and call:
```
client.products.byId("productID").update("payloadObjectWithAListOfUpdateActions")
```
```
{ [HttpError: Payload Too Large]
> message: 'Payload Too Large',
> body:
> { statusCode: 413,
> message: 'The update actions count of 997 exceeds the limit of 500.',
> errors: [ [Object] ],
> originalRequest:
> { endpoint: '/products/88efbf61-c140-458b-97dd-069f763bb592',
> payload: [Object],
> options: [Object] } },
> name: 'HttpError',
> statusCode: 413,
> code: 413 } 'Skipping product due to error message: Payload Too Large'
```
Contributor guide
Assessment
This issue has not been assessed yet.