You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's an interesting case that can arise if a network action fails right after login but before the main window is shown - I hit this in Qubes while testing #567
STR
Login
Expected Behavior
Main window is shown.
Actual Behavior
If the network actions after the login fail, then the main window never launches, and the API actions are never retried. The application must be restarted.
Comments
This is the logic in the controller causing this issue:
In on_authenticate_success we hide the login window, we start a sync, then we use self.api.get_current_user - this last call can fail.
If self.api.get_current_user fails, then on_get_current_user_failure is triggered - it tries to show an error in the gui - but the gui is not displayed yet, since we display the main GUI in the success callback.
In terms of how to resolve, this is happening because we want to pass a user object to the gui such that we can show the nice journalist icon with their name. Here are two ways to proceed:
Provide all the details we want from the /user endpoint in the response from the authentication/token endpoint (just first name, last name I think). Then we don't need to do another round trip.
or
Display the main GUI window regardless of success or failure, and update the user info once we get the details. Use the queue to get the current user details such that it will automatically retry if it fails.
1 seems more straightforward to me but either should work. @creviera I vaguely recall we discussed providing the first name and last name in the response from the /token endpoint before, I forget why we decided not to implement it though.
The text was updated successfully, but these errors were encountered:
Description
Here's an interesting case that can arise if a network action fails right after login but before the main window is shown - I hit this in Qubes while testing #567
STR
Login
Expected Behavior
Main window is shown.
Actual Behavior
If the network actions after the login fail, then the main window never launches, and the API actions are never retried. The application must be restarted.
Comments
This is the logic in the controller causing this issue:
on_authenticate_success
we hide the login window, we start a sync, then we useself.api.get_current_user
- this last call can fail.self.api.get_current_user
fails, thenon_get_current_user_failure
is triggered - it tries to show an error in the gui - but the gui is not displayed yet, since we display the main GUI in the success callback.In terms of how to resolve, this is happening because we want to pass a
user
object to the gui such that we can show the nice journalist icon with their name. Here are two ways to proceed:or
1 seems more straightforward to me but either should work. @creviera I vaguely recall we discussed providing the first name and last name in the response from the
/token
endpoint before, I forget why we decided not to implement it though.The text was updated successfully, but these errors were encountered: