diff --git a/static/app/utils/analytics/replayAnalyticsEvents.tsx b/static/app/utils/analytics/replayAnalyticsEvents.tsx index d9d3b9e9687734..c6d25fc86b00da 100644 --- a/static/app/utils/analytics/replayAnalyticsEvents.tsx +++ b/static/app/utils/analytics/replayAnalyticsEvents.tsx @@ -1,5 +1,5 @@ import type {LayoutKey} from 'sentry/utils/replays/hooks/useReplayLayout'; -import type {Output} from 'sentry/views/explore/replays/detail/network/details/getOutputType'; +import type {Output} from 'sentry/views/explore/replays/detail/network/details/output'; export type ReplayEventParameters = { 'replay.ai-summary.chapter-clicked': { diff --git a/static/app/utils/replays/types.tsx b/static/app/utils/replays/types.tsx index 706c5eb818e38f..f68fe585a6d7aa 100644 --- a/static/app/utils/replays/types.tsx +++ b/static/app/utils/replays/types.tsx @@ -13,8 +13,6 @@ import type { } from '@sentry/react'; import invariant from 'invariant'; -import type {Event} from 'sentry/types/event'; - export type {serializedNodeWithId} from '@sentry-internal/rrweb-snapshot'; export type {fullSnapshotEvent, incrementalSnapshotEvent} from '@sentry-internal/rrweb'; @@ -214,8 +212,13 @@ export function isFeedbackFrame(frame: ReplayFrame | undefined): frame is Feedba return Boolean(frame && 'category' in frame && frame.category === 'feedback'); } -export function isHydrateCrumb(item: BreadcrumbFrame | Event): item is BreadcrumbFrame { - return 'category' in item && item.category === 'replay.hydrate-error'; +export function isHydrateCrumb(item: unknown): item is BreadcrumbFrame { + return ( + typeof item === 'object' && + item !== null && + 'category' in item && + item.category === 'replay.hydrate-error' + ); } export function isSpanFrame(frame: ReplayFrame | undefined): frame is SpanFrame { diff --git a/static/app/views/explore/replays/detail/network/details/content.tsx b/static/app/views/explore/replays/detail/network/details/content.tsx index 3953f8339825da..05cac34d6fc2bf 100644 --- a/static/app/views/explore/replays/detail/network/details/content.tsx +++ b/static/app/views/explore/replays/detail/network/details/content.tsx @@ -6,14 +6,12 @@ import {trackAnalytics} from 'sentry/utils/analytics'; import {getFrameMethod, getFrameStatus} from 'sentry/utils/replays/resourceFrame'; import {useOrganization} from 'sentry/utils/useOrganization'; import {FluidHeight} from 'sentry/views/explore/replays/detail/layout/fluidHeight'; -import { - getOutputType, - Output, -} from 'sentry/views/explore/replays/detail/network/details/getOutputType'; +import {getOutputType} from 'sentry/views/explore/replays/detail/network/details/getOutputType'; import { Setup, UnsupportedOp, } from 'sentry/views/explore/replays/detail/network/details/onboarding'; +import {Output} from 'sentry/views/explore/replays/detail/network/details/output'; import type {SectionProps} from 'sentry/views/explore/replays/detail/network/details/sections'; import { GeneralSection, diff --git a/static/app/views/explore/replays/detail/network/details/getOutputType.tsx b/static/app/views/explore/replays/detail/network/details/getOutputType.tsx index d80a3648a60853..a68c597cc3c04e 100644 --- a/static/app/views/explore/replays/detail/network/details/getOutputType.tsx +++ b/static/app/views/explore/replays/detail/network/details/getOutputType.tsx @@ -1,18 +1,8 @@ import {isRequestFrame} from 'sentry/utils/replays/resourceFrame'; +import {Output} from 'sentry/views/explore/replays/detail/network/details/output'; import type {SectionProps} from 'sentry/views/explore/replays/detail/network/details/sections'; import type {TabKey} from 'sentry/views/explore/replays/detail/network/details/tabs'; -export enum Output { - SETUP = 'setup', - UNSUPPORTED = 'unsupported', - URL_SKIPPED = 'url_skipped', - BODY_SKIPPED = 'body_skipped', - BODY_PARSE_ERROR = 'body_parse_error', - BODY_PARSE_TIMEOUT = 'body_parse_timeout', - UNPARSEABLE_BODY_TYPE = 'unparseable_body_type', - DATA = 'data', -} - type Args = { isCaptureBodySetup: boolean; isSetup: boolean; diff --git a/static/app/views/explore/replays/detail/network/details/onboarding.spec.tsx b/static/app/views/explore/replays/detail/network/details/onboarding.spec.tsx index 3a2dcf85a873a2..20ee4955601779 100644 --- a/static/app/views/explore/replays/detail/network/details/onboarding.spec.tsx +++ b/static/app/views/explore/replays/detail/network/details/onboarding.spec.tsx @@ -6,8 +6,8 @@ import {textWithMarkupMatcher} from 'sentry-test/utils'; import {hydrateSpans} from 'sentry/utils/replays/hydrateSpans'; import {useProjectSdkNeedsUpdate} from 'sentry/utils/useProjectSdkNeedsUpdate'; -import {Output} from 'sentry/views/explore/replays/detail/network/details/getOutputType'; import {Setup} from 'sentry/views/explore/replays/detail/network/details/onboarding'; +import {Output} from 'sentry/views/explore/replays/detail/network/details/output'; jest.mock('sentry/utils/useProjectSdkNeedsUpdate'); diff --git a/static/app/views/explore/replays/detail/network/details/onboarding.tsx b/static/app/views/explore/replays/detail/network/details/onboarding.tsx index c0398059da6ffa..a6c5825ce44ac6 100644 --- a/static/app/views/explore/replays/detail/network/details/onboarding.tsx +++ b/static/app/views/explore/replays/detail/network/details/onboarding.tsx @@ -16,7 +16,7 @@ import type {SpanFrame} from 'sentry/utils/replays/types'; import {useDismissAlert} from 'sentry/utils/useDismissAlert'; import {useOrganization} from 'sentry/utils/useOrganization'; import {useProjectSdkNeedsUpdate} from 'sentry/utils/useProjectSdkNeedsUpdate'; -import {Output} from 'sentry/views/explore/replays/detail/network/details/getOutputType'; +import {Output} from 'sentry/views/explore/replays/detail/network/details/output'; import type {TabKey} from 'sentry/views/explore/replays/detail/network/details/tabs'; export const useDismissReqRespBodiesAlert = () => { diff --git a/static/app/views/explore/replays/detail/network/details/output.tsx b/static/app/views/explore/replays/detail/network/details/output.tsx new file mode 100644 index 00000000000000..d0636c0992eccb --- /dev/null +++ b/static/app/views/explore/replays/detail/network/details/output.tsx @@ -0,0 +1,10 @@ +export enum Output { + SETUP = 'setup', + UNSUPPORTED = 'unsupported', + URL_SKIPPED = 'url_skipped', + BODY_SKIPPED = 'body_skipped', + BODY_PARSE_ERROR = 'body_parse_error', + BODY_PARSE_TIMEOUT = 'body_parse_timeout', + UNPARSEABLE_BODY_TYPE = 'unparseable_body_type', + DATA = 'data', +}