High performance self-hosted photo and video management solution.
TypeScript backup-toolfluttergoogle-photosgoogle-photos-alternativejavascriptmobile-appnestjsnodejsphoto-galleryphotosphotos-managementself-hostedsveltesveltekittypescriptvideos
fix: ignore external libraries for integrity report checksum check (#29248)
Daniel Dietzlerc484bd99b61b
diff --git a/server/src/queries/integrity.repository.sql b/server/src/queries/integrity.repository.sqlindex b9ff92b091..d9940970d9 100644--- a/server/src/queries/integrity.repository.sql+++ b/server/src/queries/integrity.repository.sql@@ -129,6 +129,7 @@ fromand "integrity_report"."type" = $1where"asset"."deletedAt" is null+ and "asset"."isExternal" = falseand "integrity_report"."createdAt" >= $2and "integrity_report"."createdAt" <= $3order bydiff --git a/server/src/repositories/integrity.repository.ts b/server/src/repositories/integrity.repository.tsindex 84ba4bdf48..12f0b98634 100644--- a/server/src/repositories/integrity.repository.ts+++ b/server/src/repositories/integrity.repository.ts@@ -177,6 +177,7 @@ export class IntegrityRepository {'asset.id as assetId','integrity_report.id as reportId',])+ .where('asset.isExternal', '=', sql.lit(false)).$if(startMarker !== undefined, (qb) => qb.where('integrity_report.createdAt', '>=', startMarker!)).$if(endMarker !== undefined, (qb) => qb.where('integrity_report.createdAt', '<=', endMarker!)).orderBy('integrity_report.createdAt', 'asc')diff --git a/server/test/medium/specs/services/integrity.service.spec.ts b/server/test/medium/specs/services/integrity.service.spec.tsindex 758fb5ab00..db0f6f3ff2 100644--- a/server/test/medium/specs/services/integrity.service.spec.ts+++ b/server/test/medium/specs/services/integrity.service.spec.ts@@ -686,6 +686,22 @@ describe(IntegrityService.name, () => {nextCursor: undefined,});});++ it('should skip external library files', async () => {+ const { sut, ctx } = setup();+ const job = ctx.getMock(JobRepository);+ job.queue.mockResolvedValue(void 0);++ const { user } = await ctx.newUser();++ await ctx.newAsset({ ownerId: user.id, isExternal: true });++ await sut.handleChecksumFiles({ refreshOnly: false });++ await expect(+ ctx.get(IntegrityRepository).getIntegrityReport({ limit: 100 }, IntegrityReport.ChecksumFail),+ ).resolves.toEqual({ items: [], nextCursor: undefined });+ });});describe('handleChecksumRefresh', () => {