gyselroth / balloon-client-desktop

balloon desktop client for Windows, Mac OS X and Linux
GNU General Public License v3.0
10 stars 3 forks source link

Client does not recover after closing the window during auth wizard #211

Open raffis opened 4 years ago

raffis commented 4 years ago

Describe the bug

balloon is running in the background if a startup wizard window gets closed.

To Reproduce

  1. Start empty balloon or unlinked account
  2. The wizard prompts server, enter server
  3. The wizard prompts for credentials, close window
  4. balloon is now hidden and can not be recovered
  5. One must kill the balloon process manually

Expected behavior

If the auth window gets closed (or any other window during the wizard while no tray is displayed) the client must be killed completely since there is no advantage of keeping it running the background anyway.

Environment

pixtron commented 4 years ago

@raffis just tested both cases (fresh install and unlinked account) with client v1.2.0. The process gets quit with the following log entries:

2019-12-02 10:11:37 ERROR <main> [startup]: failed ask for credentials ({"error":{"stack":"Error: auth window closed by user\n    at BrowserWindow.windowClosedByUserHandler (/Applications/Balloon.app/Contents/Resources/app.asar/app/ui/startup/controller.js:135:20)\n    at emitOne (events.js:121:20)\n    at BrowserWindow.emit (events.js:211:7)","message":"auth window closed by user"}})
2019-12-02 10:11:37 ERROR <main> [main]: startup checkconfig ({"error":{"stack":"Error: auth window closed by user\n    at BrowserWindow.windowClosedByUserHandler (/Applications/Balloon.app/Contents/Resources/app.asar/app/ui/startup/controller.js:135:20)\n    at emitOne (events.js:121:20)\n    at BrowserWindow.emit (events.js:211:7)","message":"auth window closed by user"}})

Could we get the logs when the issue occurs?

pixtron commented 4 years ago

Issue was accidentally closed because of commit mentioning wrong issue.

pixtron commented 4 years ago

Was able to reproduce this behavior on windows, after #161 occured and startup window was closed. Although not every time.

pixtron commented 4 years ago

The error is reproducible, after a login attempt failed (token,basic or oidc). The closed event should probably only be removed before the window is closed after a successful login.

https://github.com/gyselroth/balloon-client-desktop/blob/39f00005a818df5658de847a814fa72e917ab4d9/app/ui/startup/controller.js#L191 https://github.com/gyselroth/balloon-client-desktop/blob/39f00005a818df5658de847a814fa72e917ab4d9/app/ui/startup/controller.js#L148