When I call the delete api from my angular app with the correct parameters, the success action is triggered and the behavior is as expected. If any of the parameters or the url is wrong, I get the expected 401, 403 or 422 responses, and the failure action is triggered, but when it's a 500 error, the failure action does not get triggered and the app stays in a pending state as if the api never completed. Any idea why a 500 error would fail to trigger an action?
deleteItems$ = createEffect(() =>
this.actions$.pipe(
ofType(deleteItems),
withLatestFrom(this.store.pipe(select(getUser))),
switchMap(([action, user]) => {
return this.itemService.deleteItems(
user.company?.id ?? '',
action.itemIds
).pipe(
map(() => deleteItemsSuccess(),
catchError(response => of(
deleteItemsFailure({
error: response.message
})
)))
)
})
)
)
This isn't a case of having a 1st level catchError causing the effect to complete it's observable stream. It can be called multiple times after the 500 error.