Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(278)

Issue 8596048: Fix login called twice in some cases.

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years ago by frankban
Modified:
11 years ago
Reviewers:
mp+160690, teknico, jeff.pihach
Visibility:
Public.

Description

Fix login called twice in some cases. Login was called twice in some cases. The first time by the connectedChange subscriber reacting to a WebSocket connection/reconnection. The second time only if the credentials are available (stashed in the storage or just provided in config) and the user is not authenticated. AFAICT, the latter case is completely redundant, given that the two conditions above are both true only at the beginning of the auth process, started right after the WebSocket is connected, so, reasonably, when the login is already attempted by the connectedChange subscriber. QA: Try to login with or without setting user and password in config. Refresh, logout, disconnect rapi-delta, reconnect, hack! https://code.launchpad.net/~frankban/juju-gui/login-again/+merge/160690 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 1

Patch Set 2 : Fix login called twice in some cases. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+169 lines, -58 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M app/app.js View 2 chunks +18 lines, -19 lines 0 comments Download
M test/test_app.js View 1 1 chunk +149 lines, -39 lines 0 comments Download

Messages

Total messages: 4
frankban
Please take a look.
11 years ago (2013-04-24 15:43:38 UTC) #1
jeff.pihach
LGTM Thanks a lot for doing this fix! https://codereview.appspot.com/8596048/diff/1/test/test_app.js File test/test_app.js (right): https://codereview.appspot.com/8596048/diff/1/test/test_app.js#newcode214 test/test_app.js:214: container.remove(); ...
11 years ago (2013-04-24 16:36:26 UTC) #2
teknico
LGTM, nice catch and comments, lots of tests, great job!
11 years ago (2013-04-24 17:04:48 UTC) #3
frankban
11 years ago (2013-04-24 17:16:38 UTC) #4
*** Submitted:

Fix login called twice in some cases.

Login was called twice in some cases. 
The first time by the connectedChange subscriber reacting to a
WebSocket connection/reconnection. The second time only if the 
credentials are available (stashed in the storage or just
provided in config) and the user is not authenticated.
AFAICT, the latter case is completely redundant, given
that the two conditions above are both true only
at the beginning of the auth process, started right
after the WebSocket is connected, so, reasonably, 
when the login is already attempted by the connectedChange
subscriber.

QA:

Try to login with or without setting user and password in
config. Refresh, logout, disconnect rapi-delta, reconnect,
hack!

R=jeff.pihach, teknico
CC=
https://codereview.appspot.com/8596048
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b