-
-
Notifications
You must be signed in to change notification settings - Fork 4k
fix: filter null duplicate assets #21507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Does changing the |
1de22c1
to
ce3e4f1
Compare
Changing to innerJoinLateral does fix it, though I wonder if doing an inner join or my original solution means there are some duplicates that will end up being filtered out and never shown to the user. |
The query you posted doesn't include the exif columns, does it? That's why the lateral join exists. |
Nice approach! I think that one would return the same result as the inner join lateral. Unfortunately, I think it'd be slower. |
Yeah I think you're right. Both return 554 entries on my instance, and all that json conversions have a non-zero impact. The thought was that an innerJoinLateral might omit perfectly valid duplicate assets that were missing an entry on asset_exif, while a leftJoin will find duplicates and include exif if it exists otherwise set exif data to null. But, I'm not very familiar with this codebase so maybe my initial assumption of the issue arising from non-existing asset_exif is wrong. |
It's an edge case. The expectation is that there's a row in the exif table, since it's an earlier step before embeddings are generated etc. The row would exist after metadata extraction succeeds regardless of how much metadata the asset has. But it's technically possible for the row to be missing, so it's fair to address that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should run make sql
with a running dev instance to update the generated SQL file.
Description
Fixes #18884
On my Immich instance, trying to use the
/utilities/duplicates
menu resulted in an internal server error:How Has This Been Tested?
/utilities/duplicates
worked now.Screenshots (if appropriate)
Same error screen as #18884
Checklist:
src/services/
uses repositories implementations for database calls, filesystem operations, etc.src/repositories/
is pretty basic/simple and does not have any immich specific logic (that belongs insrc/services/
)other notes
Not sure if a test is applicable here, would be nice to prevent regressions, but I wasn't able to cleanly replicate the bug in a test environment.
I believe it's related to an asset not having a corresponding asset_exif entry, but I've tried uploading duplicates stripped of exif data and that didn't reproduce the error. My production instance is >1tb, so trying to debug that didn't seem feasible. So, in the end, I just added a null check.