Here's the flow:
- Creates a connector
- Attach an event listener to it
- Initialize the connection with connector.initializeConnection()
On the event callback I remove the event listener and/or run dispose() on the connector
a. If I don't run the dispose() [which doesn't look like I should in the first place] the connection simply does not respond, the onReady function of my event listener is never called. On the browser console I see the following:
debug Server responded with information on how to contact device. Opening communication channel... debug contacting device
b. If I run the dispose() and try to use that same connector from the beginning of this flow, it fails on the step [3]. I realize I shouldn't try to use the connector after disposing it but since it throws an unhandled exception then it's probably an issue that should be addressed. Error bellow:
On my second attempt to connect I see a POST to https://apisandbox.dev.clover.com/v2/...pay?accesstoken={access_token} with response {sent: true, token: "C030UQ53830477", host: "wss://apisandbox.dev.clover.com", requestAccess: false}