test: serialise the buffer over events

This commit is contained in:
izzy
2025-12-01 11:20:34 +00:00
parent c4ac8d9f63
commit 01f96de3e5
6 changed files with 27 additions and 13 deletions

View File

@@ -371,7 +371,11 @@ export class IntegrityService extends BaseService {
await this.jobRepository.queue({
name: JobName.IntegrityChecksumFilesRefresh,
data: {
items: batchReports,
items: batchReports.map(({ path, reportId, checksum }) => ({
path,
reportId,
checksum: checksum?.toString('hex'),
})),
},
});
@@ -505,7 +509,7 @@ export class IntegrityService extends BaseService {
}),
]);
if (checksum.equals(hash.digest())) {
if (Buffer.from(checksum, 'hex').equals(hash.digest())) {
return reportId;
}
} catch (error) {

View File

@@ -296,7 +296,7 @@ export interface IIntegrityPathWithReportJob {
}
export interface IIntegrityPathWithChecksumJob {
items: { path: string; reportId: string | null; checksum?: Buffer | null }[];
items: { path: string; reportId: string | null; checksum?: string | null }[];
}
export interface JobCounts {