immich icon indicating copy to clipboard operation
immich copied to clipboard

"Favorite" appears to revert after editing an image's location metadata in the same image view 'session'

Open jcookin opened this issue 5 months ago • 1 comments

I have searched the existing issues, both open and closed, to make sure this is not a duplicate report.

  • [x] Yes

The bug

Summary

This issue pertains to the favorite feature of images, and unexpected behavior caused by editing metadata. Specifically, when editing the location field of an image.

This appears to a web-only issue (simple test on mobile did not immediately recreate).

Observed Behavior

Starting with an image that has not been favorite-d and has no location metadata, opening the image into full view, marking as favorite then editing and saving the location metadata (and possible others) causes the favorite status to be undone. Exiting out and back in typically shows the full image view with the filled in heart favorite status correctly, but the thumbnail views do not show the heart icon as expected.

The reverse is true, as well. Mark an image as favorite, return to the thumbnail mode, then click back to the image. Editing the location data again causes the image to be unmarked as a favorite (however, the heart icon may still be showing as opaque/filled in indicating favorite status). Returning to the thumbnail view shows no heart icon on the image, then returning back to full image view no longer has a favorite icon status.

Reloading the webpage after this behavior is observed causes the correct icon status to be shown. Thus the assumption it is a web-only issue, not server side (as well as no error logs in the server).

The OS that Immich Server is running on

Ubuntu Server 20.04.6 LTS

Version of Immich Server

v1.134.0

Version of Immich Mobile App

v1.134.0

Platform with the issue

  • [ ] Server
  • [x] Web
  • [ ] Mobile

Your docker-compose.yml content

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    ports:
      - 2283:2283
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    depends_on:
      - redis
      - database
    restart: always
    networks: ["common", "net"]

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

  redis:
    container_name: immich_redis
    image: redis:6.2-alpine@sha256:70a7a5b641117670beae0d80658430853896b5ef269ccf00d1827427e3263fa3
    restart: always
    networks: ["common"]

  database:
    container_name: immich_postgres
    image: ghcr.io/immich-app/postgres:14-vectorchord0.3.0-pgvectors0.2.0
    env_file:
      - .env
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      # Uncomment the DB_STORAGE_TYPE: 'HDD' var if your database isn't stored on SSDs
      DB_STORAGE_TYPE: 'HDD'
    volumes:
      - pgdata:/var/lib/postgresql/data
    restart: always
    networks: ["common"]

volumes:
  pgdata:
  model-cache:

networks:
  net:
    external: true
  common:

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=/mnt/data/all/immich

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

# Connection secrets for postgres and typesense. You should change these to random passwords
DB_PASSWORD=<password>

# 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 an non-favorited image fully (i.e. not the thumbnail)
  2. Click "Favorite", ensure the heart icon is filled in indicating it is marked as favorite
  3. Immediate open the "info" panel and enter the edit section for Add a location (or edit if existing)
  4. Select a location, then save
  5. Observe the "favorite" icon is no longer filled in, instead reverted to the outline heart shape
  6. esc/exit back to the thumbnail view, observe no favorite heart icon on the image

Relevant log output

No relevant logs identified in the Browser (via console).
Server logs not in highly verbose mode, and appears to be a web only issue.

Additional information

No response

jcookin avatar Jun 10 '25 06:06 jcookin

Tested and confirmed. This seems to occur whenever any edit is made to the asset (tag, description, date, location, etc.)

xCJPECKOVERx avatar Jun 11 '25 01:06 xCJPECKOVERx

There is something wrong with store management. Even that API is returning favorite true, Web is not displaying it properly

pwojtaszko avatar Aug 03 '25 21:08 pwojtaszko

Issue is that websocket is modifying this value basing on authenticated user:

  • server/src/services/notification.service.ts -> onAssetMetadataExtracted -> mapAsset mapAsset requires auth object to properly return isFavorite: isFavorite: options.auth?.user.id === entity.ownerId ? entity.isFavorite : false, This issue is caused by workaround that is preventing to show "shared" favorite in shared album: https://github.com/immich-app/immich/pull/7580 I tried to remove this workaround but issue that it fixes is still there.

pwojtaszko avatar Aug 04 '25 21:08 pwojtaszko

@danieldietzler pls take a look. I prepared fix for this issue

pwojtaszko avatar Aug 19 '25 20:08 pwojtaszko

There's no need to ping, we're aware of open PRs. There's currently a huge backlog (as you can see we're close to 100 PRs), so slowly making our way through those :)

danieldietzler avatar Aug 19 '25 20:08 danieldietzler

Sidecar writing has some issues related to race conditions. This applies to everything we sync to xmp files.

jrasm91 avatar Sep 11 '25 20:09 jrasm91