Cable-Desktop/libtextsecure
lilia fd6e2954f7 Curtail over-zealous websocket reconnects
Closes #173

Previously, in the event of a failed websocket auth, we would attempt to
reconnect once a second ad infinitum. This changeset ensures that we
only reconnect automatically if the socket closed 'normally' as
indicated by the code on the socket's CloseEvent. Otherwise, show a
'Websocket closed' error on the inbox view.

Ideally we would show a more contextual error (ie, 'Unauthorized'), but
unfortunately the actual server response code is not available to our
code. It can be observed in the console output from the background page,
but programmatically, we only receive the WebSocket CloseEvent codes
listed here:
https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent#Status_codes

The websocket error message is displayed by a normally-hidden but ever
present socket status element. Clicking this element will immediately
refresh the background page, which will try again to open the websocket
connection.
2015-03-09 16:04:26 -07:00
..
storage De-duplicate registrationId in deviceObject 2015-02-12 15:12:01 -08:00
test Move test vectors to libaxolotl 2015-02-12 15:12:01 -08:00
api.js Move prekey sigcheck to libaxolotl 2015-02-12 15:11:59 -08:00
axolotl_wrapper.js Remove non-existant device messages 2015-02-26 12:13:56 -08:00
components.js Regenerate components/libts 2015-01-14 11:39:36 -10:00
crypto.js Remove all external non-test deps on libaxolotl/crypto 2015-02-12 15:11:59 -08:00
errors.js Move js files around for libtextsecure split 2015-01-14 09:35:57 -10:00
helpers.js Check END_SESSION messages in processDecrypted 2015-02-26 12:11:05 -08:00
libaxolotl_concat.js Preserve whitespace in _concat files 2015-02-20 15:34:49 -08:00
protobufs.js Move protocol protobufs to libaxolotl/, handling DeviceControl 2015-02-12 15:11:58 -08:00
sendmessage.js Dont send group-update right before we quit the group 2015-02-25 15:59:49 -08:00
storage.js Move js files around for libtextsecure split 2015-01-14 09:35:57 -10:00
stringview.js Move js files around for libtextsecure split 2015-01-14 09:35:57 -10:00
websocket-resources.js Move js files around for libtextsecure split 2015-01-14 09:35:57 -10:00
websocket.js Curtail over-zealous websocket reconnects 2015-03-09 16:04:26 -07:00