Some days in the timeline are shuffled #2568

Closed
opened 2026-02-05 06:12:40 +03:00 by OVERLORD · 0 comments
Owner

Originally created by @jenda69 on GitHub (Mar 12, 2024).

The bug

Some older pictures (or more precisely their days) from an external library are ordered really wonky in my timeline on the web.

Note: I'll use the 07/2011 as an example in this report because that is where I first noticed this, but I can see many other months with same issue in my Immich. It also seems that at least on the web, this occurs in blocks of months - days within month are shuffled, but months are always in the correct order.

See screenshot:
image
The screenshot is from Favorites but the main timeline does the same thing.

Photos should be ordered from new to old, but this particular month has days displayed in order 2, 4, 3, 10, 5, 6, 16. (the 6 is cropped in the screenshot and I just noticed that 3 and 4 actually changed position when I was writing this report)
Clicking next / previous in the photo view also changes to unexpected photos.

More in additional info.

The OS that Immich Server is running on

Raspbian Bookworm

Version of Immich Server

v1.98.2

Version of Immich Mobile App

v1.98.2

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

version: "3.8"

name: immich

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    command: [ "start.sh", "immich" ]
    volumes:
      - ${UPLOAD_LOCATION_SLOW}/upload:/usr/src/app/upload
      - ${UPLOAD_LOCATION_FAST}/upload/thumbs:/usr/src/app/upload/thumbs
      - ${UPLOAD_LOCATION_FAST}/upload/upload:/usr/src/app/upload/upload
      - /etc/localtime:/etc/localtime:ro
      - ${EXTERNAL_PATH_SLOW}/jenda/fotky:/usr/src/app/external/jenda:ro
      - ${UPLOAD_LOCATION_SLOW}/upload/library/hanka:/storage/immich/upload/library/hanka:ro
      - ${EXTERNAL_PATH_SLOW}/hanka/fotky:/usr/src/app/external/hanka:ro
    env_file:
      - .env
    ports:
      - 2283:3001
    depends_on:
      - redis
      - database
    restart: always

  immich-microservices:
    container_name: immich_microservices
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    # extends:
    #   file: hwaccel.yml
    #   service: hwaccel
    command: [ "start.sh", "microservices" ]
    volumes:
      - ${UPLOAD_LOCATION_SLOW}/upload:/usr/src/app/upload
      - ${UPLOAD_LOCATION_FAST}/upload/thumbs:/usr/src/app/upload/thumbs
      - ${UPLOAD_LOCATION_FAST}/upload/upload:/usr/src/app/upload/upload
      - /etc/localtime:/etc/localtime:ro
      - ${EXTERNAL_PATH_SLOW}/jenda/fotky:/usr/src/app/external/jenda:ro
      - ${UPLOAD_LOCATION_SLOW}/upload/library/hanka:/storage/immich/upload/library/hanka:ro
      - ${EXTERNAL_PATH_SLOW}/hanka/fotky:/usr/src/app/external/hanka:ro
    env_file:
      - .env
    depends_on:
      - redis
      - database
    restart: always

  immich-machine-learning:
    container_name: immich_machine_learning
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    volumes:
      - ${UPLOAD_LOCATION_SLOW}/model-cache:/cache
    env_file:
      - .env
    restart: always

  redis:
    container_name: immich_redis
    image: redis:6.2-alpine@sha256:b6124ab2e45cc332e16398022a411d7e37181f21ff7874835e0180f56a09e82a
    restart: always

  database:
    container_name: immich_postgres
    image: tensorchord/pgvecto-rs:pg14-v0.1.11@sha256:0335a1a22f8c5dd1b697f14f079934f5152eaaa216c09b61e293be285491f8ee
    env_file:
      - .env
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
    volumes:
      - ${UPLOAD_LOCATION_FAST}/pgdata:/var/lib/postgresql/data
    ports:
      - 5432:5432
    restart: always

Your .env content

# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables

# The location where your uploaded files are stored
UPLOAD_LOCATION_FAST=/storage-fast/immich
UPLOAD_LOCATION_SLOW=/storage/immich
EXTERNAL_PATH_FAST=/storage-fast/user
EXTERNAL_PATH_SLOW=/storage/user

# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=release

# Connection secret for postgres. You should change it to a random password
DB_PASSWORD=IwontPostMyPasswordHere

# The values below this line do not need to be changed
###################################################################################
DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

REDIS_HOSTNAME=immich_redis

Reproduction steps

1. Open immich
2. Have photos with inconsistent Exif
3. Scroll through the timeline
4. Days are shuffled

Additional information

I tried looking into the database and it seems this is similar to my issue #7178 - the only correct date/time column for the affected photos is localDateTime, which is also the date and time displayed in the UI.
The other fileCreated/Modified dates are from last year. Probably when I imported the library into Digikam and updated some EXIF and XMP tags for etc., it modified the modify date

I checked some photos with Exiftool:
localDateTime in the DB matches both [EXIF] Date/Time Original and [EXIF] Create Date; fileCreatedAt & fileModified match [EXIF] Modify Date

If I use this query in the DB:
SELECT * FROM "assets" WHERE "localDateTime" < '2011-08-01' AND "localDateTime" >= '2011-07-01' AND "isFavorite" = 'True' ORDER BY "fileModifiedAt" DESC
I can see the days in the timeline are in the same order as are the first occurrences of every day in fileModifiedAt column. (I could probably achieve exact order using GROUP BY or something but I'm not good in SQL).

Related to that, if I open a photo and click next/prev arrow, the photos don't actually change in the order of the timeline, but in the order of the query above.

I'll post this as separate issue, but it really seems like it's the same issue as #7178 - Immich displays localDateTime everywhere but uses other date/time columns to actually process, sort etc. photos and these columns are not necessarily correct in my library.

I'm also fairly sure I have a related issue with the Android app. In the main timeline, days are ordered correctly there but are missing more than a half of the photos. In the favorites timeline, there's only one day for the whole month displayed (should be much more as seen on screenshot from web above). This is where I actually noticed there's something wrong in my timeline and it seems the issue occurs in the same months as the weird behaviour on the web.

Originally created by @jenda69 on GitHub (Mar 12, 2024). ### The bug Some older pictures (or more precisely their days) from an external library are ordered really wonky in my timeline on the web. Note: I'll use the 07/2011 as an example in this report because that is where I first noticed this, but I can see many other months with same issue in my Immich. It also seems that at least on the web, this occurs in blocks of months - days within month are shuffled, but months are always in the correct order. See screenshot: ![image](https://github.com/immich-app/immich/assets/932875/96807ee8-9c6d-464b-9f55-aef96cb7479f) The screenshot is from Favorites but the main timeline does the same thing. Photos should be ordered from new to old, but this particular month has days displayed in order 2, 4, 3, 10, 5, 6, 16. (the 6 is cropped in the screenshot and I just noticed that 3 and 4 actually changed position when I was writing this report) Clicking next / previous in the photo view also changes to unexpected photos. More in additional info. ### The OS that Immich Server is running on Raspbian Bookworm ### Version of Immich Server v1.98.2 ### Version of Immich Mobile App v1.98.2 ### Platform with the issue - [X] Server - [X] Web - [X] Mobile ### Your docker-compose.yml content ```YAML version: "3.8" name: immich services: immich-server: container_name: immich_server image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} command: [ "start.sh", "immich" ] volumes: - ${UPLOAD_LOCATION_SLOW}/upload:/usr/src/app/upload - ${UPLOAD_LOCATION_FAST}/upload/thumbs:/usr/src/app/upload/thumbs - ${UPLOAD_LOCATION_FAST}/upload/upload:/usr/src/app/upload/upload - /etc/localtime:/etc/localtime:ro - ${EXTERNAL_PATH_SLOW}/jenda/fotky:/usr/src/app/external/jenda:ro - ${UPLOAD_LOCATION_SLOW}/upload/library/hanka:/storage/immich/upload/library/hanka:ro - ${EXTERNAL_PATH_SLOW}/hanka/fotky:/usr/src/app/external/hanka:ro env_file: - .env ports: - 2283:3001 depends_on: - redis - database restart: always immich-microservices: container_name: immich_microservices image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} # extends: # file: hwaccel.yml # service: hwaccel command: [ "start.sh", "microservices" ] volumes: - ${UPLOAD_LOCATION_SLOW}/upload:/usr/src/app/upload - ${UPLOAD_LOCATION_FAST}/upload/thumbs:/usr/src/app/upload/thumbs - ${UPLOAD_LOCATION_FAST}/upload/upload:/usr/src/app/upload/upload - /etc/localtime:/etc/localtime:ro - ${EXTERNAL_PATH_SLOW}/jenda/fotky:/usr/src/app/external/jenda:ro - ${UPLOAD_LOCATION_SLOW}/upload/library/hanka:/storage/immich/upload/library/hanka:ro - ${EXTERNAL_PATH_SLOW}/hanka/fotky:/usr/src/app/external/hanka:ro env_file: - .env depends_on: - redis - database restart: always immich-machine-learning: container_name: immich_machine_learning image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release} volumes: - ${UPLOAD_LOCATION_SLOW}/model-cache:/cache env_file: - .env restart: always redis: container_name: immich_redis image: redis:6.2-alpine@sha256:b6124ab2e45cc332e16398022a411d7e37181f21ff7874835e0180f56a09e82a restart: always database: container_name: immich_postgres image: tensorchord/pgvecto-rs:pg14-v0.1.11@sha256:0335a1a22f8c5dd1b697f14f079934f5152eaaa216c09b61e293be285491f8ee env_file: - .env environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} volumes: - ${UPLOAD_LOCATION_FAST}/pgdata:/var/lib/postgresql/data ports: - 5432:5432 restart: always ``` ### Your .env content ```Shell # You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables # The location where your uploaded files are stored UPLOAD_LOCATION_FAST=/storage-fast/immich UPLOAD_LOCATION_SLOW=/storage/immich EXTERNAL_PATH_FAST=/storage-fast/user EXTERNAL_PATH_SLOW=/storage/user # The Immich version to use. You can pin this to a specific version like "v1.71.0" IMMICH_VERSION=release # Connection secret for postgres. You should change it to a random password DB_PASSWORD=IwontPostMyPasswordHere # The values below this line do not need to be changed ################################################################################### DB_HOSTNAME=immich_postgres DB_USERNAME=postgres DB_DATABASE_NAME=immich REDIS_HOSTNAME=immich_redis ``` ### Reproduction steps ```bash 1. Open immich 2. Have photos with inconsistent Exif 3. Scroll through the timeline 4. Days are shuffled ``` ### Additional information I tried looking into the database and it seems this is similar to my issue #7178 - the only correct date/time column for the affected photos is `localDateTime`, which is also the date and time displayed in the UI. The other fileCreated/Modified dates are from last year. Probably when I imported the library into Digikam and updated some EXIF and XMP tags for etc., it modified the modify date I checked some photos with Exiftool: `localDateTime` in the DB matches both _[EXIF] Date/Time Original_ and _[EXIF] Create Date_; `fileCreatedAt` & `fileModified` match _[EXIF] Modify Date_ If I use this query in the DB: `SELECT * FROM "assets" WHERE "localDateTime" < '2011-08-01' AND "localDateTime" >= '2011-07-01' AND "isFavorite" = 'True' ORDER BY "fileModifiedAt" DESC` I can see the days in the timeline are in the same order as are the first occurrences of every day in `fileModifiedAt` column. (I could probably achieve exact order using GROUP BY or something but I'm not good in SQL). Related to that, if I open a photo and click next/prev arrow, the photos don't actually change in the order of the timeline, but in the order of the query above. I'll post this as separate issue, but it really seems like it's the same issue as #7178 - Immich displays `localDateTime` everywhere but uses other date/time columns to actually process, sort etc. photos and these columns are not necessarily correct in my library. I'm also fairly sure I have a related issue with the Android app. In the main timeline, days are ordered correctly there but are missing more than a half of the photos. In the favorites timeline, there's only one day for the whole month displayed (should be much more as seen on screenshot from web above). This is where I actually noticed there's something wrong in my timeline and it seems the issue occurs in the same months as the weird behaviour on the web.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#2568