From eb9a2edf465e1429dd54302645e46d6b32f112dd Mon Sep 17 00:00:00 2001 From: Harika <153644847+hjetpoluru@users.noreply.github.com> Date: Thu, 31 Oct 2024 12:57:09 -0400 Subject: [PATCH] chore: Cherry pick data deletion into v12.6.0 (#28223) ## **Description** Cherry-pick PR https://github.com/MetaMask/metamask-extension/pull/28221 [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/28223?quickstart=1) Co-authored-by: Mark Stacey --- app/scripts/services/data-deletion-service.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/app/scripts/services/data-deletion-service.ts b/app/scripts/services/data-deletion-service.ts index 3bdafc03b582..5ec9ede75a87 100644 --- a/app/scripts/services/data-deletion-service.ts +++ b/app/scripts/services/data-deletion-service.ts @@ -12,11 +12,17 @@ import { import getFetchWithTimeout from '../../../shared/modules/fetch-with-timeout'; import { DeleteRegulationStatus } from '../../../shared/constants/metametrics'; -const DEFAULT_ANALYTICS_DATA_DELETION_SOURCE_ID = - process.env.ANALYTICS_DATA_DELETION_SOURCE_ID ?? 'test'; -const DEFAULT_ANALYTICS_DATA_DELETION_ENDPOINT = - process.env.ANALYTICS_DATA_DELETION_ENDPOINT ?? - 'https://metametrics.metamask.test'; +const inTest = process.env.IN_TEST; +const fallbackSourceId = 'test'; +const fallbackDataDeletionEndpoint = 'https://metametrics.metamask.test'; + +const DEFAULT_ANALYTICS_DATA_DELETION_SOURCE_ID = inTest + ? fallbackSourceId + : process.env.ANALYTICS_DATA_DELETION_SOURCE_ID ?? fallbackSourceId; +const DEFAULT_ANALYTICS_DATA_DELETION_ENDPOINT = inTest + ? fallbackDataDeletionEndpoint + : process.env.ANALYTICS_DATA_DELETION_ENDPOINT ?? + fallbackDataDeletionEndpoint; /** * The number of times we retry a specific failed request to the data deletion API.