-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
fix: remove duplicateIds on unique assets #13752
base: main
Are you sure you want to change the base?
Conversation
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.
Some code style comments, but looks good overall! I was thinking of adding a nightly check for this, but lazily checking when you fetch them is smarter.
web/src/routes/(user)/utilities/duplicates/[[photos=photos]]/[[assetId=id]]/+page.ts
Outdated
Show resolved
Hide resolved
web/src/routes/(user)/utilities/duplicates/[[photos=photos]]/[[assetId=id]]/+page.ts
Outdated
Show resolved
Hide resolved
web/src/routes/(user)/utilities/duplicates/[[photos=photos]]/[[assetId=id]]/+page.ts
Outdated
Show resolved
Hide resolved
Would this be better to do on the server side? It'd save a bunch of round trips etc. |
Yeah, that makes sense to me. |
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.
Nice, much better, thanks!
@@ -15,8 +15,24 @@ import { usePagination } from 'src/utils/pagination'; | |||
export class DuplicateService extends BaseService { | |||
async getDuplicates(auth: AuthDto): Promise<DuplicateResponseDto[]> { | |||
const res = await this.assetRepository.getDuplicates({ userIds: [auth.user.id] }); | |||
|
|||
return mapDuplicateResponse(res.map((a) => mapAsset(a, { auth, withStack: true }))); | |||
const uniqueAssetIds: string[] = []; |
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.
Naming nitpick: These aren't necessarily unique, right (more accurately, all assetIds are unique)? Not sure what a better name would be though.
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.
singletonDuplicateIds
?
fixes: #11637
Issue Overview
A bug was identified in the review duplicates utility where, after manually deleting a duplicate image, the corresponding group was still displayed with a single leftover image.
Changes
We validate the duplicates in duplicates utility page by checking if each duplicate set has atleast 2 assets. If not we update the assets to remove duplicates ids from them and do not show them on the page.