immich-app / immich

High performance self-hosted photo and video management solution.
https://immich.app
GNU Affero General Public License v3.0
44.63k stars 2.17k forks source link

[BUG] Signing out of one tab doesn't sign out of other open tabs #6055

Closed xethlyx closed 5 days ago

xethlyx commented 8 months ago

The bug

When multiple tabs of Immich are open, signing out of one tab won't sign out of the other tabs, leaving them in a weird state where API requests silently fail.

Additionally, by signing in to another tab on another account (let's call this account B) will make the other tab's requests work again, without updating the account displayed on the top right. The app shows the photos of account B while still showing it's signed in to account A.

The OS that Immich Server is running on

Debian GNU/Linux 12 (bookworm)

Version of Immich Server

v1.91.4

Version of Immich Mobile App

None

Platform with the issue

Your docker-compose.yml content

version: "3.8"

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:release
    command: ["start-server.sh"]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
    env_file:
      - stack.env
    depends_on:
      - redis
      - database
    restart: always
    ports:
      - 2283:3001

  immich-microservices:
    container_name: immich_microservices
    image: ghcr.io/immich-app/immich-server:release
    command: ["start-microservices.sh"]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
    env_file:
      - stack.env
    depends_on:
      - redis
      - database
    restart: always

  immich-machine-learning:
    container_name: immich_machine_learning
    image: ghcr.io/immich-app/immich-machine-learning:release
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /mnt/sata/data/immich/model-cache:/cache
    env_file:
      - stack.env
    restart: always

  redis:
    container_name: immich_redis
    image: redis:6.2
    restart: always

  database:
    container_name: immich_postgres
    image: tensorchord/pgvecto-rs:pg14-v0.1.11
    env_file:
      - stack.env
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      PG_DATA: /var/lib/postgresql/data
    volumes:
      - /mnt/sata/data/immich/pgdata:/var/lib/postgresql/data
    restart: always

Your .env content

DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_PASSWORD=...
DB_DATABASE_NAME=immich
REDIS_HOSTNAME=immich_redis
UPLOAD_LOCATION=/mnt/sata/photos
TYPESENSE_API_KEY=...
PUBLIC_LOGIN_PAGE_MESSAGE=
IMMICH_WEB_URL=http://immich-web:3000
IMMICH_SERVER_URL=http://immich-server:3001
IMMICH_MACHINE_LEARNING_URL=http://immich-machine-learning:3003

Reproduction steps

1. Open two tabs of Immich
2. Log out on one tab
3. Go to the other tab

Additional information

I was in the progress of migrating all my data from one server to another and happened to encounter this bug. I've verified that it occurs on both servers (one running Kubernetes with the helm chart at immich-app/immich-charts, and the other running Docker Compose).

Also, thanks for making such awesome app! This was the only bug I've recently encountered.

alextran1502 commented 8 months ago

I cannot reproduce the behavior, when you go to the other tab, ctrl + F5 would show you the login form, correct?

xethlyx commented 8 months ago

Yea, pressing ctrl f5 does show the login form. I'll see if I can get a video when I get home later to better explain it.

xethlyx commented 8 months ago

Here's a video that hopefully shows the problem better:

https://github.com/immich-app/immich/assets/46338199/a5748f1b-345c-409b-ad77-8e916d01b200

Notably, at 0:12, clicking on the images doesn't work. At 0:30, the signed in user is displayed wrong.