Page MenuHomePhabricator

ipoid: Use consistent patterns for asynchronous code
Closed, DeclinedPublic

Description

Summary

Node.js has three patterns for asynchronicity: callbacks, chained promises and async/await. Codebases should generally aim to pick one for consistency to make the flow easier to follow.

ipoid currently mixes the latter two, and also uses async functions in a few places (e.g. as callbacks) that aren't documented to support async functions. This makes it difficult to reason about the order of operations.

We should try to use async/await more consistently and review our integrations with callbacks.

Acceptance criteria

  • ipoid is consistently using async/await over other asynchronicity patterns