fix: feature face update ignores soft-deleted faces (#31533)

This commit is contained in:
Daniel Dietzler
2026-09-14 09:47:02 -04:00
committed by GitHub
parent 53395d0664
commit ef9718e93d
3 changed files with 16 additions and 0 deletions
+1
View File
@@ -616,6 +616,7 @@ from
where
"asset_face"."assetId" = $2
and "asset_face"."personGroupId" = $3
and "asset_face"."deletedAt" is null
-- PersonRepository.getForMergePerson
select
@@ -767,6 +767,7 @@ export class PersonRepository {
.select('asset_face.id')
.where('asset_face.assetId', '=', assetId)
.where('asset_face.personGroupId', '=', personGroupId)
.where('asset_face.deletedAt', 'is', null)
.innerJoin('asset', (join) => join.onRef('asset.id', '=', 'asset_face.assetId').on('asset.isOffline', '=', false))
.executeTakeFirst();
}
@@ -228,4 +228,18 @@ describe(PersonRepository.name, () => {
);
});
});
describe('getForFeatureFaceUpdate', () => {
it('should ignore soft deleted faces', async () => {
const { ctx, sut } = setup();
const { user } = await ctx.newUser();
const { asset } = await ctx.newAsset({ ownerId: user.id });
const { person } = await ctx.newPerson({ ownerId: user.id });
await ctx.newAssetFace({ assetId: asset.id, deletedAt: new Date(), personGroupId: person.personGroupId });
await expect(
sut.getForFeatureFaceUpdate({ personGroupId: person.personGroupId, assetId: asset.id }),
).resolves.toEqual(undefined);
});
});
});