Skip to content

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

@ybnd

Description

@ybnd

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcode taskerror handlingHow errors are handled from REST APImedium prioritystaleThis issue or PR is stale because it has not been updated in a long time.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions