handshake-org / handshake-org/hsd
long-running processes could emit "progress" events
- Dominant language
- JavaScript
- Stars
- 2.1k
- Forks
- 306
- PR merge metrics
- No merged PRs in 30d
Description
Some RPC calls like wallet rescan return `success: true` right away even though from a UX perspective, the rescan has just begun:
https://github.com/handshake-org/hsd/blob/eea15c2f2d6b3371eefb3bb7a93d08185bc9e25f/lib/wallet/http.js#L189-L201
Other RPC calls like the WIP [dumpzone](https://github.com/handshake-org/hsd/pull/534) or `pruneblockchain` may timeout long before completion since the http timeout is only 5 seconds (from `brq`).
I was thinking we could establish a convention where these calls always return some kind of "in progress" message once initiated so they don't time out, and then the process itself can emit "progress" events that can either be listened to by the caller (i.e. bob wallet UI) or even from the command line similar to [`hsw-cli listen`](https://github.com/handshake-org/hs-client/blob/41306b2a8ba86b239d72cb6ae47aa17f93883b49/bin/hsw-cli#L274-L306)
Contributor guide
Assessment
This issue has not been assessed yet.