Bug 12337 - Miniature UI can't handle incorrect FICS login
: Miniature UI can't handle incorrect FICS login
Status: CLOSED FIXED
Product: Miniature
UI
: master
: other other
: High major (vote)
: 0.4
Assigned To: Michael Hasselmann
: general
:
:
:
:
  Show dependency tree
 
Reported: 2011-08-24 21:49 UTC by Quim Gil
Modified: 2011-09-18 07:52 UTC (History)
2 users (show)

See Also:


Attachments
Wrong FICS login UI (72.92 KB, image/png)
2011-08-29 21:10 UTC, Quim Gil
Details


Note

You need to log in before you can comment on or make changes to this bug.


Description Quim Gil (reporter) 2011-08-24 21:49:56 UTC
SOFTWARE VERSION: 
0.3 in N9

EXACT STEPS LEADING TO PROBLEM: 
1. Introduce credential in FICS login page.

EXPECTED OUTCOME: 
- If credentials were right, the user should log in as identified user (not
sure if this is working already).
- If credentials were wrong, a dialog should popup and ask to retry.

ACTUAL OUTCOME: 
No matter what, you get to SeekGame with the listing of apps.

REPRODUCIBILITY: 
always
Comment 1 Quim Gil (reporter) 2011-08-24 21:50:44 UTC
Assigning to me for the creation of the dialog.
Comment 2 Quim Gil (reporter) 2011-08-29 00:51:44 UTC
(In reply to comment #0)
> EXPECTED OUTCOME: 
> - If credentials were right, the user should log in as identified user (not
> sure if this is working already).

It does.
Comment 3 Quim Gil (reporter) 2011-08-29 21:10:01 UTC
Created an attachment (id=3407) [details]
Wrong FICS login UI

Wrong FICS login UI

Needs to be connected to backend. You can test it setting the variable
loginCorrect = wrong in line 113.

https://gitorious.org/miniature/miniature/commit/cad7ff13bf58dd1c9a6d98082e470cf1aafef38d
Comment 4 Quim Gil (reporter) 2011-08-29 21:12:32 UTC
Renaming bug to reflect the current status. mikhas, can you connect the login
button events to the backend, or explain me how to do it? Thanks.
Comment 5 Michael Hasselmann 2011-09-02 02:48:50 UTC
Next item on list.
Comment 6 Michael Hasselmann 2011-09-04 01:11:28 UTC
Fixed with commit b47f8af3f2e55457824270a3434e0235f0b984d7. Though perhaps the
QML UI needs a bit more work here: When I login incorrectly the second time, it
is already all red. Perhaps just have a red flash on incorrect login?
Comment 7 Quim Gil (reporter) 2011-09-04 08:49:35 UTC
Reopening, since I can login with whatever wrong combination of ID & PSW.
Copied from the console:

FICS: ""Asfgjk" is not a registered name.  You may use this name to play
unrated games." 
FICS: "(After logging in, do "help register" for more info on how to
register.)" 
FICS: "Press return to enter the server as "Asfgjk"" 
FICS: "" 
FICS: "**** Starting FICS session as Asfgjk(U) ****" 

Ok, I will look at the UI once I can see it working in a real case.
Comment 8 Quim Gil (reporter) 2011-09-04 11:59:02 UTC
Added a spinner active during the login process:
http://gitorious.org/miniature/miniature/commit/b6380119c2e4817f10d53b261feaaaf8aeaa1c0e

There is a way to test wrong logins now: just try to login introducing one
character in the login field. FICS won't digest that and the red background
will show up. Now I see what you mean and I will fix it.
Comment 9 Quim Gil (reporter) 2011-09-04 19:11:58 UTC
Now we have a 2s red flash instead of a permanent red state which, I agree, is
a lot nicer:
http://gitorious.org/miniature/miniature/commit/122392c0cdca84f2407fd57ec6277eded16d59f9

Also, thanks to this we can detect a bug now: 

1. Introduce "q" and "q" as login and password. Press login.
2. FICS doesn't like very short IDs, so it will complain. Red flash animation
comes.
3. Wait.

Expected: nothing happens unless user tries to login again.

Actually: A second red flash comes alone. Just one time, like an echo. Always.

The console log:

void Game::Frontend::Miniature::login(const QString&, const QString&) 
virtual void Game::Command::Login::exec(Game::Dispatcher*,
Game::AbstractEngine*) 41 
virtual void Game::Command::Login::exec(Game::Dispatcher*,
Game::AbstractEngine*) 46 
FICS: "             _       __     __                             __      " 
FICS: "            | |     / /__  / /________  ____ ___  ___     / /_____ " 
FICS: "            | | /| / / _ \/ / ___/ __ \/ __ `__ \/ _ \   / __/ __ \" 
FICS: "            | |/ |/ /  __/ / /__/ /_/ / / / / / /  __/  / /_/ /_/ /" 
FICS: "            |__/|__/\___/_/\___/\____/_/ /_/ /_/\___/   \__/\____/ " 
FICS: "       ^^__                  _____________________                 _  _ 
_ " 
FICS: "      /  - \_               / ____/  _/ ____/ ___/   _            | ||
|| |" 
FICS: "    <|    __<              / /_   / // /    \__ \   (_)          
|_______|" 
FICS: "    <|    \               / __/ _/ // /___ ___/ /  _              \__
___ /" 
FICS: "    <|     \             /_/   /___/\____//____/  (_)             
|___|_|" 
FICS: "    <|______\                                                     
|_|___|" 
FICS: "     _|____|_        ======================================       
|___|_|" 
FICS: "    (________)         freechess.org  ----  69.36.243.188        
(_______)" 
FICS: "    /________\       ======================================      
/_______\ " 
FICS: "                       (Login screen designed by Alefith)" 
FICS: "   ****** Welcome to the Free Internet Chess Server at freechess.org
******" 
FICS: "Webpage" 
FICS: " http" 
FICS: "//www.freechess.org" 
FICS: "Head admin " 
FICS: " Chessty   Complaints to " 
FICS: " complaints@freechess.org" 
FICS: "Server location" 
FICS: " freechess.org   Server version " 
FICS: " 1.25.17" 
FICS: "      If you are not a registered player, enter guest or a unique ID." 
FICS: "             (If your return key does not work, use cntrl-J)" 
FICS: "login" 
FICS: " " 
FICS: "A name should be at least three characters long!  Try again." 
FICS: "      If you are not a registered player, enter guest or a unique ID." 
FICS: "             (If your return key does not work, use cntrl-J)" 
FICS: "login" 
virtual void Game::Command::LoginFailed::exec(Game::Dispatcher*,
Game::Frontend::Miniature*) 36 
Failed to login in with as "Q" 
virtual void Game::Command::LoginFailed::exec(Game::Dispatcher*,
Game::Frontend::Miniature*) 36 
FICS: " "
Comment 10 Quim Gil (reporter) 2011-09-04 19:21:16 UTC
Ok, so it looks like the problem is simply that loginFailed Miniature should
disconnect completely from FICS, right?
Comment 11 Quim Gil (reporter) 2011-09-04 19:41:09 UTC
I've tried to fix this by doing:

Connections {
        target: miniature
        onLoginFailed: {
            miniature.logout()
            ...

But it doesn't disconnect. This dispatcher keeps coming once more. I better
leave this to mikas.
Comment 12 Michael Hasselmann 2011-09-05 23:32:59 UTC
(In reply to comment #11)
> I've tried to fix this by doing:
> 
> Connections {
>         target: miniature
>         onLoginFailed: {
>             miniature.logout()
>             ...
> 
> But it doesn't disconnect. This dispatcher keeps coming once more. I better
> leave this to mikas.

Disconnect from FICS for every failed login? I am not sure I like that - it
takes around 2-5 seconds or so to login to FICS. Simply need to debug why the
failed login is reported twice (perhaps due to the failed password handling?)
Comment 13 Michael Hasselmann 2011-09-05 23:50:57 UTC
Fixed echo with commit 116d1a7152a4ac0c910241ac49380e08f1bf3fc3 - forgot to
stop a timer.
Comment 14 Michael Hasselmann 2011-09-06 00:03:17 UTC
(In reply to comment #7)
> Reopening, since I can login with whatever wrong combination of ID & PSW.
> Copied from the console:
> 
> FICS: ""Asfgjk" is not a registered name.  You may use this name to play
> unrated games." 
> FICS: "(After logging in, do "help register" for more info on how to
> register.)" 
> FICS: "Press return to enter the server as "Asfgjk"" 
> FICS: "" 
> FICS: "**** Starting FICS session as Asfgjk(U) ****" 
> 
> Ok, I will look at the UI once I can see it working in a real case.

Ahem, I missed that comment … FICS chooses to log you in as guest here -
currently, Miniature cannot differentiate between guest logins and registered
logins. So I either get a password prompt (valid username) or the guest login
confirmation (invalid username) - and the latter should *not* log us in but
produce a failed login message? Will look into that (REOPEN, of course).
Comment 15 Michael Hasselmann 2011-09-06 00:17:45 UTC
(In reply to comment #12)
> (In reply to comment #11)
> > I've tried to fix this by doing:
> > 
> > Connections {
> >         target: miniature
> >         onLoginFailed: {
> >             miniature.logout()
> >             ...
> > 
> > But it doesn't disconnect. This dispatcher keeps coming once more. I better
> > leave this to mikas.
> 
> Disconnect from FICS for every failed login? I am not sure I like that - it
> takes around 2-5 seconds or so to login to FICS. Simply need to debug why the
> failed login is reported twice (perhaps due to the failed password handling?)

Hah, I *have* to disconnect if FICS thinks it's a guest login, because there's
no other way back to login prompt - you either press return (logs you in), or
you quit …

I *love* how the FICS protocol makes such trivial things as login so unreliable
to handle. Well done, FICS.
Comment 16 Michael Hasselmann 2011-09-06 00:30:14 UTC
Fixed guest login handling with abfbfbe2edd412d0e3768f51322c83103fc5c968. I
need to apologize for my sloppiness: I think I only tested registered accounts
previously. Thanks for taking bug verification serious!
Comment 17 Michael Hasselmann 2011-09-06 00:33:29 UTC
Oh by the way (perhaps a new bug, as it is purely UX):
1. When entering username, enter key on virtual keyboard should bring you to
password field,
2. when entering password, enter key on virtual keyboard should log you in.
3. After sending user credentials, UI should grey out login prompt until FICS
response arrives (otherwise no visual feedback if login takes a bit longer,
say, due to crappy internet connection).
Comment 18 Quim Gil (reporter) 2011-09-06 02:34:52 UTC
(In reply to comment #17)
> Oh by the way (perhaps a new bug, as it is purely UX):
> 1. When entering username, enter key on virtual keyboard should bring you to
> password field,
> 2. when entering password, enter key on virtual keyboard should log you in.
> 3. After sending user credentials, UI should grey out login prompt until FICS
> response arrives (otherwise no visual feedback if login takes a bit longer,
> say, due to crappy internet connection).

Filed at https://bugs.maemo.org/show_bug.cgi?id=12375

The rest works as expected. Verifying. Thanks!