diff --git a/services/history-v1/storage/lib/backupDeletion.mjs b/services/history-v1/storage/lib/backupDeletion.mjs index b52c31a160..ef50609753 100644 --- a/services/history-v1/storage/lib/backupDeletion.mjs +++ b/services/history-v1/storage/lib/backupDeletion.mjs @@ -51,7 +51,8 @@ async function deleteProjectBackup(projectId) { throw new NotReadyToDelete('refusing to delete non-expired project') } - const historyId = deletedProject.deleterData.deletedProjectOverleafHistoryId + const historyId = + deletedProject.deleterData.deletedProjectOverleafHistoryId?.toString() if (!historyId) { throw new NotReadyToDelete( 'refusing to delete project with unknown historyId' diff --git a/services/history-v1/test/acceptance/js/api/backupDeletion.test.mjs b/services/history-v1/test/acceptance/js/api/backupDeletion.test.mjs index 72af62b1d2..46512d1b92 100644 --- a/services/history-v1/test/acceptance/js/api/backupDeletion.test.mjs +++ b/services/history-v1/test/acceptance/js/api/backupDeletion.test.mjs @@ -50,7 +50,7 @@ async function deleteProject(projectId) { } /** - * @param {string|ObjectId} historyId + * @param {number|ObjectId} historyId * @return {Promise} */ async function expectToHaveBackup(historyId) { @@ -61,7 +61,7 @@ async function expectToHaveBackup(historyId) { } /** - * @param {string|ObjectId} historyId + * @param {number|ObjectId} historyId * @return {Promise} */ async function expectToHaveNoBackup(historyId) { @@ -90,7 +90,7 @@ describe('backupDeletion', function () { }) describe('DELETE /project/:projectId', function () { - const postgresHistoryId = '1' + const postgresHistoryId = 1 const projectIdPostgres = new ObjectId('000000000000000000000001') const projectIdMongoDB = new ObjectId('000000000000000000000002') const projectIdNonDeleted = new ObjectId('000000000000000000000003')