Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Immich v1.106.4 logout issue - iOS #10444

Closed
1 of 3 tasks
LucaTheHacker opened this issue Jun 17, 2024 · 1 comment
Closed
1 of 3 tasks

Immich v1.106.4 logout issue - iOS #10444

LucaTheHacker opened this issue Jun 17, 2024 · 1 comment

Comments

@LucaTheHacker
Copy link

LucaTheHacker commented Jun 17, 2024

The bug

Since recent updates, I've been noticing unprecedented issues with Immich login. From time to time, when I open the app, I have to log in again. Endpoint is usually kept (apart one time where it defaulted to demo), but this is becoming annoying.

I've investigated the logs, and I've noticed that AuthenticationNotifier returns ApiException 400 even if the error is related to the network:

ApiException 400: Socket operation failed: GET /users/me (Inner exception: Failed host lookup: 'photos.domain.example')

#0      IOClient.send (package:http/src/io_client.dart:94)
<asynchronous suspension>
#1      BaseClient._sendUnstreamed (package:http/src/base_client.dart:93)
<asynchronous suspension>
#2      ApiClient.invokeAPI (package:openapi/api_client.dart:101)
<asynchronous suspension>
#3      UsersApi.getMyUser (package:openapi/api/users_api.dart:177)
<asynchronous suspension>
#4      AuthenticationNotifier.setSuccessLoginInfo (package:immich_mobile/providers/authentication.provider.dart:182)
<asynchronous suspension>
#5      SplashScreenPage.build.performLoggingIn (package:immich_mobile/pages/common/splash_screen.page.dart:55)
<asynchronous suspension>

This raises an exception that causes the App to go to SplashScreenPage: Unable to login through offline or online methods - logging out completely.

After doing so, the client tries to log-out, but due to the network error, it fails as well:

ApiException 400: Socket operation failed: POST /auth/logout (Inner exception: Failed host lookup: 'photos.domain.example')

#0      IOClient.send (package:http/src/io_client.dart:94)
<asynchronous suspension>
#1      BaseClient._sendUnstreamed (package:http/src/base_client.dart:93)
<asynchronous suspension>
#2      ApiClient.invokeAPI (package:openapi/api_client.dart:96)
<asynchronous suspension>
#3      AuthenticationApi.logout (package:openapi/api/authentication_api.dart:140)
<asynchronous suspension>
#4      AuthenticationNotifier.logout.<anonymous closure> (package:immich_mobile/providers/authentication.provider.dart:106)
<asynchronous suspension>
  1. Authentication should only be reset if status_code == 401 || status_code == 403, as it's the proper code for Authorization issues.
  2. If the endpoint isn't reachable, 5xx class status codes should be used instead of 4xx, preventing the aforementioned issues
  3. If logout fails, the client shouldn't consider itself as logged out, as the logout didn't effectively happen. A force log-out may be useful, but it should be clear for the user that his session has not been closed properly.

The OS that Immich Server is running on

TrueNAS Scale

Version of Immich Server

v1.106.4

Version of Immich Mobile App

v.106.4

Platform with the issue

  • Server
  • Web
  • Mobile
@bo0tzz
Copy link
Member

bo0tzz commented Jun 18, 2024

Dupe: #8146

@bo0tzz bo0tzz closed this as not planned Won't fix, can't repro, duplicate, stale Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants