dspace-angular icon indicating copy to clipboard operation
dspace-angular copied to clipboard

Data services: Errors when constructing request endpoints could result in deadlocks

Open ybnd opened this issue 1 year ago • 0 comments

Describe the bug

In #1848 we address an issue with AuthRequestService during initialization (caused here)

  • With the REST server down, getEndpoint would throw an error and the request would never be sent
  • The return value ~ buildFromRequestUUID would 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

ybnd avatar Sep 22 '22 10:09 ybnd