3box / 3box-js

3Box JavaScript SDK: User identities, storage, messaging
MIT License
207 stars 65 forks source link

box.auth hangs or takes a very long time #848

Open dkent600 opened 4 years ago

dkent600 commented 4 years ago

Since upgrading to the latest in 3box, I've been seeing very long wait times or an outright hang when called box.auth.

I often see this exception which comes from the "p-some" package which is pulled in by 3box@1.20.0.

This is on rinkeby. Haven't tried mainnet.

AggregateError: 
    TypeError: socket.terminate is not a function
        at Object.stream.destroy (webpack-internal:///./node_modules/it-ws/client.js:21:12)
        at Object.close (webpack-internal:///./node_modules/libp2p-websockets/src/socket-to-conn.js:59:16)
        at async Upgrader.upgradeOutbound (webpack-internal:///./node_modules/libp2p/src/upgrader.js:178:7)
        at async ClassIsWrapper.dial (webpack-internal:///./node_modules/libp2p-websockets/src/index.js:45:18)
        at async TransportManager.dial (webpack-internal:///./node_modules/libp2p/src/transport-manager.js:87:14)
        at async eval (webpack-internal:///./node_modules/libp2p/src/dialer/dial-request.js:58:18)
        at async eval (webpack-internal:///./node_modules/p-some/index.js:53:19)
    at maybeSettle (webpack-internal:///./node_modules/p-some/index.js:31:11)
    at eval (webpack-internal:///./node_modules/p-some/index.js:69:23)

Steps to reproduce

  1. const box = await Box.create(web3Provider)
  2. await box.auth(["DAOstack"], { address }).

Expect box.auth should complete, and do so quickly, ideally in maximum 2 seconds.

Desktop (please complete the following information):

oed commented 4 years ago

Thanks for reporting @dkent600. Does this just cause box.auth to hang or does it throw an error and exit?

Note: this is likely related to the infrasturcture problems we are seeing currently.

dkent600 commented 4 years ago

Thanks for reporting @dkent600. Does this just cause box.auth to hang or does it throw an error and exit?

Note: this is likely related to the infrasturcture problems we are seeing currently.

When the exception is thrown auth hangs.

[UPDATE:] But frankly it often hangs even without the exception.

oed commented 4 years ago

@dkent600 We've had some service degradation of our infrastructure recently that was fixed last week. Would you mind trying this again and seeing if it's still an issue?