Shopware 6.4.5.0 now has bulk edit.
When applying changes there is a scary warning popup.
I had a look at the network tab when changing 2 products, and there is only a single call too the sync-endpoint:
So I am actually still wondering why this warning is there and if it is safe to use bulk edit, for example on unstable connections (I guess closing the browser tab or a unstable connection would have similar results?)
Bulk edit requests are executed via JavaScript. The reason you only see one request is because you are editing fewer than 50 entities, which is the chunk size for the request; ref. onSave()
method:
async onSave() {
this.isLoading = true;
this.onProcessData();
const payloadChunks = chunk(this.selectedIds, 50);
const requests = payloadChunks.map(payload => {
return this.bulkEditApiFactory.getHandler('product')
.bulkEdit(payload, this.bulkEditSelected);
});
this.bulkEditSelected = [];
return Promise.all(requests)
.then(response => {
const isSuccessful = response.every(item => item.success === true);
this.processStatus = isSuccessful ? 'success' : 'fail';
}).catch(() => {
this.processStatus = 'fail';
}).finally(() => {
this.isLoading = false;
});
},
h/t to my colleague David Neustadt for pointing out the chunking.