diff --git a/services/web/app/src/Features/ThirdPartyDataStore/TpdsQueueManager.mjs b/services/web/app/src/Features/ThirdPartyDataStore/TpdsQueueManager.mjs index 253d0f0d98..8dbdc7fdb2 100644 --- a/services/web/app/src/Features/ThirdPartyDataStore/TpdsQueueManager.mjs +++ b/services/web/app/src/Features/ThirdPartyDataStore/TpdsQueueManager.mjs @@ -4,7 +4,9 @@ import { fetchJson } from '@overleaf/fetch-utils' async function getQueues(userId) { try { - return await fetchJson(`${Settings.apis.tpdsworker.url}/queues/${userId}`) + return await fetchJson( + `${Settings.apis.thirdPartyDataStore.url}/queues/${userId}` + ) } catch (err) { throw OError.tag(err, 'failed to query TPDS queues for user', { userId }) } diff --git a/services/web/app/src/Features/ThirdPartyDataStore/TpdsUpdateSender.mjs b/services/web/app/src/Features/ThirdPartyDataStore/TpdsUpdateSender.mjs index 9b0413bfe6..a301c6703f 100644 --- a/services/web/app/src/Features/ThirdPartyDataStore/TpdsUpdateSender.mjs +++ b/services/web/app/src/Features/ThirdPartyDataStore/TpdsUpdateSender.mjs @@ -173,13 +173,12 @@ async function createProject(params) { } async function enqueue(group, method, job) { - const tpdsWorkerUrl = _.get(settings, ['apis', 'tpdsworker', 'url']) - // silently do nothing if worker url is not in settings - if (!tpdsWorkerUrl) { + const enqueueBaseUrl = _.get(settings, ['apis', 'thirdPartyDataStore', 'url']) + if (!enqueueBaseUrl) { return } try { - const url = new URL('/enqueue/web_to_tpds_http_requests', tpdsWorkerUrl) + const url = new URL('/enqueue/web_to_tpds_http_requests', enqueueBaseUrl) await fetchNothing(url, { method: 'POST', json: { group, job, method }, @@ -187,7 +186,7 @@ async function enqueue(group, method, job) { }) } catch (err) { // log error and continue - logger.error({ err, group, job, method }, 'error enqueueing tpdsworker job') + logger.error({ err, group, job, method }, 'error enqueueing tpds job') } } diff --git a/services/web/test/acceptance/config/settings.test.saas.js b/services/web/test/acceptance/config/settings.test.saas.js index 2a6ff40398..0378c812c9 100644 --- a/services/web/test/acceptance/config/settings.test.saas.js +++ b/services/web/test/acceptance/config/settings.test.saas.js @@ -33,11 +33,6 @@ const overrides = { webhookPass: 'webhook', }, - tpdsworker: { - // Disable tpdsworker in CI. - url: undefined, - }, - v1: { url: `http://127.0.0.1:25000`, user: 'overleaf', diff --git a/services/web/test/unit/src/ThirdPartyDataStore/TpdsUpdateSender.test.mjs b/services/web/test/unit/src/ThirdPartyDataStore/TpdsUpdateSender.test.mjs index 82f639fc63..25f85a494d 100644 --- a/services/web/test/unit/src/ThirdPartyDataStore/TpdsUpdateSender.test.mjs +++ b/services/web/test/unit/src/ThirdPartyDataStore/TpdsUpdateSender.test.mjs @@ -28,7 +28,7 @@ describe('TpdsUpdateSender', function () { } ctx.memberIds = [userId, collaberatorRef, readOnlyRef] ctx.enqueueUrl = new URL( - 'http://tpdsworker/enqueue/web_to_tpds_http_requests' + `${thirdPartyDataStoreApiUrl}/enqueue/web_to_tpds_http_requests` ) ctx.CollaboratorsGetter = { @@ -101,13 +101,13 @@ describe('TpdsUpdateSender', function () { }) describe('enqueue', function () { - it('should not call request if there is no tpdsworker url', async function (ctx) { + it('should not call request if thirdPartyDataStore is not configured', async function (ctx) { + delete ctx.settings.apis.thirdPartyDataStore await ctx.TpdsUpdateSender.promises.enqueue(null, null, null) ctx.FetchUtils.fetchNothing.should.not.have.been.called }) - it('should post the message to the tpdsworker', async function (ctx) { - ctx.settings.apis.tpdsworker = { url: 'http://tpdsworker' } + it('should post the message to tpds', async function (ctx) { const group0 = 'myproject' const method0 = 'somemethod0' const job0 = 'do something' @@ -123,10 +123,6 @@ describe('TpdsUpdateSender', function () { }) describe('sending updates', function () { - beforeEach(function (ctx) { - ctx.settings.apis.tpdsworker = { url: 'http://tpdsworker' } - }) - it('queues a post the file with user and file id and hash', async function (ctx) { const fileId = '4545345' const hash = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'