From 673ecbf70e32606e38041cdfbda2af28803b6d9a Mon Sep 17 00:00:00 2001 From: Malachi Willey Date: Fri, 30 May 2025 13:40:51 -0700 Subject: [PATCH] fix(search): Fix issue with tags name 'constructor' --- static/app/utils/fields/index.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/static/app/utils/fields/index.ts b/static/app/utils/fields/index.ts index ceee0536bee93c..f76b193b443f90 100644 --- a/static/app/utils/fields/index.ts +++ b/static/app/utils/fields/index.ts @@ -2581,11 +2581,11 @@ export const getFieldDefinition = ( ): FieldDefinition | null => { switch (type) { case 'replay': - if (key in REPLAY_FIELD_DEFINITIONS) { + if (REPLAY_FIELD_DEFINITIONS.hasOwnProperty(key)) { // @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message return REPLAY_FIELD_DEFINITIONS[key]; } - if (key in REPLAY_CLICK_FIELD_DEFINITIONS) { + if (REPLAY_CLICK_FIELD_DEFINITIONS.hasOwnProperty(key)) { // @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message return REPLAY_CLICK_FIELD_DEFINITIONS[key]; } @@ -2595,7 +2595,7 @@ export const getFieldDefinition = ( } return null; case 'feedback': - if (key in FEEDBACK_FIELD_DEFINITIONS) { + if (FEEDBACK_FIELD_DEFINITIONS.hasOwnProperty(key)) { // @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message return FEEDBACK_FIELD_DEFINITIONS[key]; } @@ -2625,7 +2625,7 @@ export const getFieldDefinition = ( return null; case 'log': - if (key in LOG_FIELD_DEFINITIONS) { + if (LOG_FIELD_DEFINITIONS.hasOwnProperty(key)) { // @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message return LOG_FIELD_DEFINITIONS[key]; } @@ -2644,8 +2644,11 @@ export const getFieldDefinition = ( case 'event': default: - // @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message - return EVENT_FIELD_DEFINITIONS[key] ?? null; + if (EVENT_FIELD_DEFINITIONS.hasOwnProperty(key)) { + // @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message + return EVENT_FIELD_DEFINITIONS[key]; + } + return null; } };