immich-app / immich

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

[BUG] New websocket connnection created on layout orientation change #2098

Closed assid2 closed 10 months ago

assid2 commented 1 year ago

The bug

A new websocket is created every time the layout orientation is changed portait<-> landscape on an Android Phone

immich_server | [Nest] 1 - 03/28/2023, 8:08:57 AM LOG [CommunicationGateway] New websocket connection: 2uZE2JR1UoDJrOFBAAAP immich_server | [Nest] 1 - 03/28/2023, 8:09:01 AM LOG [CommunicationGateway] New websocket connection: WY8h-viTppMbF07gAAAS immich_server | [Nest] 1 - 03/28/2023, 8:09:01 AM LOG [CommunicationGateway] New websocket connection: sxfSX2R12VQaFXecAAAT immich_server | [Nest] 1 - 03/28/2023, 8:09:02 AM LOG [CommunicationGateway] New websocket connection: wQX4ihysV9vDAsSLAAAV immich_server | [Nest] 1 - 03/28/2023, 8:11:26 AM LOG [CommunicationGateway] New websocket connection: Zp9XwifgoI_UBCeeAAAX immich_server | [Nest] 1 - 03/28/2023, 8:11:27 AM LOG [CommunicationGateway] New websocket connection: n6pOz5HwoarGj7QoAAAZ immich_microservices | [Nest] 1 - 03/28/2023, 8:12:03 AM LOG [VideoTranscodeProcessor] Converting Success ddb6df68-7222-4e5a-a2b8-c7e5e2efb6a1

The OS that Immich Server is running on

Ubuntu 22.04.2 LTS

Version of Immich Server

1.51.2

Version of Immich Mobile App

1.51.0b74

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
    entrypoint: ["/bin/sh", "./start-server.sh"]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
    env_file:
      - .env
    environment:
      - NODE_ENV=production
    depends_on:
      - redis
      - typesense
    networks:
      immich-network:
        ipv4_address: ${IPV4_NETWORK:-172.22.250}.254
    restart: always

  immich-microservices:
    container_name: immich_microservices
    image: ghcr.io/immich-app/immich-server:release
    entrypoint: ["/bin/sh", "./start-microservices.sh"]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
    env_file:
      - .env
    environment:
      - NODE_ENV=production
    depends_on:
      - redis
      - typesense
    networks:
      immich-network:
    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
      - model-cache:/cache
    env_file:
      - .env
    environment:
      - NODE_ENV=production
    networks:
      immich-network:
    restart: always

  immich-web:
    container_name: immich_web
    image: ghcr.io/immich-app/immich-web:release
    entrypoint: ["/bin/sh", "./entrypoint.sh"]
    env_file:
      - .env
    networks:
      immich-network:
    restart: always

  typesense:
    container_name: immich_typesense
    image: typesense/typesense:0.24.0
    environment:
      - TYPESENSE_API_KEY=${TYPESENSE_API_KEY}
      - TYPESENSE_DATA_DIR=/data
    logging:
      driver: none
    volumes:
      - tsdata:/data
    networks:
      immich-network:
    restart: always

  redis:
    container_name: immich_redis
    image: redis:6.2
    networks:
      immich-network:
    restart: always
  #database:
  #  container_name: immich_postgres
  #  image: postgres:14
  #  env_file:
  #    - .env
  #  environment:
  #    POSTGRES_PASSWORD: ${DB_PASSWORD}
  #    POSTGRES_USER: ${DB_USERNAME}
  #    POSTGRES_DB: ${DB_DATABASE_NAME}
  #    PG_DATA: /var/lib/postgresql/data
  #  volumes:
  #    - pgdata:/var/lib/postgresql/data
  #  restart: always

  immich-proxy:
    container_name: immich_proxy
    image: ghcr.io/immich-app/immich-proxy:release
    environment:
      # Make sure these values get passed through from the env file
      - IMMICH_SERVER_URL
      - IMMICH_WEB_URL
    ports:
      - 2283:8080
    logging:
      driver: none
    depends_on:
      - immich-server
    networks:
      immich-network:
    restart: always

volumes:
#  pgdata:
  model-cache:
  tsdata:

networks:
  immich-network:
    driver: bridge
    driver_opts:
      com.docker.network.bridge.name: br-immich
    enable_ipv6: false
    ipam:
      driver: default
      config:
        - subnet: ${IPV4_NETWORK:-172.22.250}.0/24

Your .env content

# Optional Database settings:
# DB_PORT=5432

###################################################################################
# Redis
###################################################################################

REDIS_HOSTNAME=immich_redis

# Optional Redis settings:
# REDIS_PORT=6379
# REDIS_DBINDEX=0
# REDIS_PASSWORD=
# REDIS_SOCKET=

###################################################################################
# Upload File Config
###################################################################################

UPLOAD_LOCATION=/ssdroot/data/immich/mediaassets

###################################################################################
# Log message level - [simple|verbose]
###################################################################################

LOG_LEVEL=simple

###################################################################################
# JWT SECRET
###################################################################################

# This JWT_SECRET is used to sign the authentication keys for user login
# You should set it to a long randomly generated value
# You can use this command to generate one: openssl rand -base64 128
JWT_SECRET=A0NBCzvuS/bFQoCUtUYOQ79gqmqIVYlY2f+ioVNOlrQfG+bL1ffKUGP63jQv+a4KAkMB4djerAfeLoUPS2Jz8p+X4XO1npj7MbclU+17JrFBfBmq7RfXMSHRetXTxq0NYhnpSXOdOaKKF+DB7boRJDnG1WuYYbpSooiIoUIbv7c=

###################################################################################
# Reverse Geocoding
####################################################################################

DISABLE_REVERSE_GEOCODING=false

# Reverse geocoding is done locally which has a small impact on memory usage
# This memory usage can be altered by changing the REVERSE_GEOCODING_PRECISION variable
# This ranges from 0-3 with 3 being the most precise
# 3 - Cities > 500 population: ~200MB RAM
# 2 - Cities > 1000 population: ~150MB RAM
# 1 - Cities > 5000 population: ~80MB RAM
# 0 - Cities > 15000 population: ~40MB RAM

REVERSE_GEOCODING_PRECISION=0

####################################################################################
# WEB - Optional
####################################################################################

# Custom message on the login page, should be written in HTML form.
# For example PUBLIC_LOGIN_PAGE_MESSAGE="This is a demo instance of Immich.<br><br>Email: <i>demo@demo.de</i><br>Password: <i>demo</i>"

PUBLIC_LOGIN_PAGE_MESSAGE=

#IMMICH_MACHINE_LEARNING_URL=false

TYPESENSE_API_KEY=9BciKEkV9WUB3X

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

in cli> docker compose logs -f

Rotate Mobile client orientation

Additional information

No response

manicmoose commented 1 year ago

Is this new websocket what is cauing the feed to jump back up to the top each time a rotation is done - or is that a separate bug?

EnochPrime commented 1 year ago

Is this new websocket what is cauing the feed to jump back up to the top each time a rotation is done - or is that a separate bug?

I would like to know the answer to this as well.