dxos-deprecated / sdk

DXOS SDK and tools.
GNU Affero General Public License v3.0
0 stars 2 forks source link

Create identity fails if click twice #11

Open richburdon opened 4 years ago

richburdon commented 4 years ago

If click FINISH twice at end of wallet.

May be a regression since this was reported months ago?

Please don't "resolve" this by just fixing the UX.

keyring.js?f8ce:282 Uncaught (in promise) Error: Refusing to overwrite existing key.
    at Keyring._addKeyRecord (keyring.js?f8ce:282)
    at Keyring.addKeyRecord (keyring.js?f8ce:252)
    at _callee$ (Registration.js?373c:177)
    at tryCatch (runtime.js?54a1:45)
    at Generator.invoke [as _invoke] (runtime.js?54a1:274)
    at Generator.prototype.<computed> [as next] (runtime.js?54a1:97)
    at asyncGeneratorStep (asyncToGenerator.js?9c13:3)
    at _next (asyncToGenerator.js?9c13:25)
DevTools failed to load SourceMap: Could not load content for chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/sourcemaps/contentscript.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME
DevTools failed to load SourceMap: Could not load content for chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/sourcemaps/inpage.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME
telackey commented 4 years ago

I think this bug should be transferred to teamwork. Halo is throwing an appropriate error refusing to overwrite an existing Identity with a new one.

The error is on the part of the finish button allowing you to attempt that. It should disable the button action until the first call completes, either by error or success.

dboreham commented 4 years ago

Does the HALO interface allow the caller to wait for the operation to either succeed or fail?

telackey commented 4 years ago

Yes, in fact it is the completion of the call which triggers the dismissal of the dialog (or display of an error, as the case may be).

dboreham commented 4 years ago

Can you work up a PR against the code (probably this is not in teamwork but in react-client?) that implements the necessary interlock?

dboreham commented 4 years ago

Also, can we look a bit into why the user might double click in this case? e.g. just deliberately to see what happens if you click twice, or is the identity creation taking a very long time leading to a reasonable expectation of double-clicking (in which case perhaps we should look into why that is the case)?

telackey commented 4 years ago

It does take a little time, and there is no feedback that anything is happening, so I sometimes have seen it when:

  1. The user presses Enter, nothing appears to happen, and so they click.

  2. The user clicks, nothing appears to happen, and so they click wondering if they really clicked it.

I don't think the issue is so much that it is slow (though there is definitely a bit of lag between clicking and redirecting) but rather there is zero feedback that you initiated it in the first place. If the button greyed out, or we had a spinning thing like when creating a party, I suspect that would cover a lot of it.

dboreham commented 4 years ago

Spinner sounds good. Grey is not enough of a cue to expect delay.

telackey commented 4 years ago

It is also consistent with what we do for parties (which is part of what we are doing).

dboreham commented 4 years ago

Don't do any work on this pending us finding a generic "critical section" library solution for JS/async.

dboreham commented 4 years ago

Possible solution : https://www.npmjs.com/package/async-mutex#synchronized-code-execution I've asked Max if something like this is kosher for our project.