From ea5de4984fe8a93e616cf82f539c25c54307029c Mon Sep 17 00:00:00 2001 From: Jimmy Domagala-Tang Date: Tue, 2 Dec 2025 09:20:30 -0500 Subject: [PATCH] toggling on wf feature sync endpoint since we know the request load now (#30014) GitOrigin-RevId: d7f9944caffdcb5cf42693cac7d2895026b38775 --- .../Features/Subscription/FeaturesUpdater.mjs | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/services/web/app/src/Features/Subscription/FeaturesUpdater.mjs b/services/web/app/src/Features/Subscription/FeaturesUpdater.mjs index 13a5ae9b61..368bfc4a9b 100644 --- a/services/web/app/src/Features/Subscription/FeaturesUpdater.mjs +++ b/services/web/app/src/Features/Subscription/FeaturesUpdater.mjs @@ -16,8 +16,7 @@ import AnalyticsManager from '../Analytics/AnalyticsManager.mjs' import Queues from '../../infrastructure/Queues.mjs' import Modules from '../../infrastructure/Modules.mjs' import { AI_ADD_ON_CODE } from './AiHelper.mjs' -// import { fetchNothing } from '@overleaf/fetch-utils' -import metrics from '@overleaf/metrics' +import { fetchNothing } from '@overleaf/fetch-utils' /** * Enqueue a job for refreshing features for the given user @@ -78,22 +77,21 @@ async function refreshFeatures(userId, reason) { if (featuresChanged && reason !== 'writefullEntitlementSynced') { try { // update WF with the current feature set for the user - // await fetchNothing( - // `${Settings.writefull.overleafApiUrl}/api/user/status/update-overleaf-status`, - // { - // headers: { - // 'x-api-key': Settings.writefull.overleafApiKey, - // }, - // json: { - // userOverleafId: userId, - // hasAiAssist: newFeatures.aiErrorAssistant, - // }, - // method: 'POST', - // } - // ) - // increment a metric instead of calling WF so we cna give them an idea of the # of requests they will recieve - metrics.inc('feature_sync_called_to_wf') + await fetchNothing( + `${Settings.writefull.overleafApiUrl}/api/user/status/update-overleaf-status`, + { + headers: { + 'x-api-key': Settings.writefull.overleafApiKey, + }, + json: { + userOverleafId: userId, + hasAiAssist: newFeatures.aiErrorAssistant, + }, + method: 'POST', + } + ) } catch (err) { + // continue with sync even if we cant communicate with wf logger.warn( { userId, reason }, 'failed to sync entitlement to Writefull after a feature refresh'