When tackling the retention ticket NXP-29028 where we use bulk action to add retention rules on selected documents. We observed that in the case where we have errors on server side, the nuxeo operation doesn't handle them, the logic of nuxeo operation in async mode is to start the BulkAction and then make a polling to check the status of the Bulk Action Here But when we get errors in server side, we continue the polling (check command running) but the server side didn't return any error on the command and few minutes later we get an empty status and the polling stops considering that everything is ok and dispatch a response event and the caller thinks that the command was succeed which is not the case.
I was thinking if it will be better if we can rework the polling logic to not rely on running status but to check 'ABORTED' and COMPLETED' and to continue polling while we have these two status with a given time out. If we don't satisfy the condition we will fail.
also we can improve the error handling by dispatching a specific event in this case Here.