dspace-angular
dspace-angular copied to clipboard
Data services: Errors when constructing request endpoints could result in deadlocks
Describe the bug
In #1848 we address an issue with AuthRequestService during initialization (caused here)
- With the REST server down,
getEndpointwould throw an error and the request would never be sent - The return value ~
buildFromRequestUUIDwould never resolve - This caused the NgRx effect that called this method to never finish, deadlocking initialization in turn.
This bug was fixed here by making the returned Observable depend on the output of getEndpoint. This ensures the error propagates via the returned value, where it can be handled by the caller.
Some of our data service methods use similar patterns, and are also susceptible to this bug.
As far as I'm aware this problem is less severe than it was with authentication/initialization. For example, in case the REST server is down the app will be unusable anyway and subscriptions that never resolve are not that much of an issue.
Expected behavior When sending requests, if an error occurs while constructing the endpoint it should propagate to the output Observable
Related work #1830 #1848