hsd icon indicating copy to clipboard operation
hsd copied to clipboard

long-running processes could emit "progress" events

Open pinheadmz opened this issue 4 years ago • 0 comments

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 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

pinheadmz avatar Dec 08 '21 19:12 pinheadmz