immich: fix hiding album invitations in share-sync

immich stores a notification's data as a JSON string inside the jsonb column, so data->>'albumId' was always null and no invitation was hidden. Unwrap it first.
This commit is contained in:
Ruben Hensen committed 2026-10-24 14:03:02 +02:00
1 parent 348cce6d5d
commit 71af3a9342
1 file changed
+2 -1
+2 -1
View File
@@ -103,7 +103,8 @@ data:
UPDATE notification SET "deletedAt" = now()
WHERE type = 'AlbumInvite' AND "deletedAt" IS NULL AND "readAt" IS NULL
AND description LIKE :'sender' || ' shared an album%'
AND (data->>'albumId')::uuid IN (SELECT id FROM album WHERE "createdAt" < now() - interval '7 days')
-- immich stores data as a JSON string inside the jsonb
AND ((data #>> '{}')::jsonb ->> 'albumId')::uuid IN (SELECT id FROM album WHERE "createdAt" < now() - interval '7 days')
""",
sender=group_name,
)