Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {CodeSnippet} from 'sentry/components/codeSnippet';
import {Flex} from 'sentry/components/container/flex';
import {ContentSliderDiff} from 'sentry/components/contentSliderDiff';
import {Alert} from 'sentry/components/core/alert';
import {LinkButton} from 'sentry/components/core/button/linkButton';
import {TabList, TabPanels, Tabs} from 'sentry/components/core/tabs';
import {sourceMapSdkDocsMap} from 'sentry/components/events/interfaces/crashContent/exception/utils';
import {FeedbackModal} from 'sentry/components/featureFeedback/feedbackModal';
Expand Down Expand Up @@ -738,12 +739,14 @@ export function SourceMapsDebuggerModal({
<UploadedSourceFileWithCorrectDebugIdChecklistItem
shouldValidate={sourceResolutionResults.stackFrameDebugId !== null}
sourceResolutionResults={sourceResolutionResults}
projectSlug={project?.slug}
/>
<UploadedSourceMapWithCorrectDebugIdChecklistItem
shouldValidate={
sourceResolutionResults.uploadedSourceFileWithCorrectDebugId
}
sourceResolutionResults={sourceResolutionResults}
projectSlug={project?.slug}
/>
</CheckList>
{sourceResolutionResults.debugIdProgressPercent === 1 ? (
Expand Down Expand Up @@ -1255,12 +1258,58 @@ function HasDebugIdChecklistItem({
);
}

function DebugIdMismatchMessage({
debugId,
projectSlug,
}: {
debugId: string | null;
projectSlug?: string;
}) {
// At this point debugId is always defined. The types need to be fixed
if (!debugId) {
return (
<Fragment>
{t(
"You already uploaded artifacts with Debug IDs but none of the uploaded source files had a Debug ID matching this stack frame's Debug ID"
)}
</Fragment>
);
}
Comment on lines +1265 to +1277
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
debugId: string | null;
projectSlug?: string;
}) {
// At this point debugId is always defined. The types need to be fixed
if (!debugId) {
return (
<Fragment>
{t(
"You already uploaded artifacts with Debug IDs but none of the uploaded source files had a Debug ID matching this stack frame's Debug ID"
)}
</Fragment>
);
}
debugId: string;
projectSlug?: string;
}) {


return tct(
"You already uploaded artifacts with Debug IDs but none of the uploaded source files had a Debug ID matching this stack frame's Debug ID: [debugId]",
{
debugId: projectSlug ? (
<LinkButton
to={{
pathname: `/settings/projects/${projectSlug}/source-maps/`,
query: {
query: debugId,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we just do something like debugId! here to get rid of the unnecessary case above?

Copy link
Member Author

@priscilawebdev priscilawebdev Jun 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can. but I usually avoid the usage of !

},
}}
icon={<IconOpen />}
aria-label={t('View source map Debug ID %(debugId)s in project settings', {
debugId,
})}
Comment on lines +1291 to +1293
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
aria-label={t('View source map Debug ID %(debugId)s in project settings', {
debugId,
})}
aria-label={t('View source map Debug ID %(debugId)s in project settings', {
debugId,
})}

can we just use tct here or is t preferred?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to always have a string for aria-labels, and tct returns a React Node

size="xs"
>
{debugId}
</LinkButton>
) : (
<MonoBlock>{debugId}</MonoBlock>
),
}
);
}

function UploadedSourceFileWithCorrectDebugIdChecklistItem({
sourceResolutionResults,
shouldValidate,
projectSlug,
}: {
shouldValidate: boolean;
sourceResolutionResults: FrameSourceMapDebuggerData;
projectSlug?: string;
}) {
const platform = getPlatform(sourceResolutionResults);
const sourceMapsDocLinks = getSourceMapsDocLinks(platform);
Expand All @@ -1281,21 +1330,16 @@ function UploadedSourceFileWithCorrectDebugIdChecklistItem({
<CheckListInstruction type="muted">
<h6>{t('No Source File With Matching Debug ID')}</h6>
<p>
{tct(
"You already uploaded artifacts with Debug IDs but none of the uploaded source files had a Debug ID matching this stack frame's Debug ID: [debugId]",
{
debugId: (
<MonoBlock>{sourceResolutionResults.stackFrameDebugId}</MonoBlock>
),
}
)}
<DebugIdMismatchMessage
projectSlug={projectSlug}
debugId={sourceResolutionResults.stackFrameDebugId}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add sourceResolutionResults.stackFrameDebugId to the if and make debugId non-nullable

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to ensure this part of the code always renders, even if debugID is null - which shouldn't happen, but just in case. That's why we need to fix the types.

/>
</p>
<p>
{t(
'Make sure to inject Debug IDs into all of your source files and to upload all of them to Sentry.'
)}
</p>
{/* TODO: Link to Uploaded Artifacts */}
</CheckListInstruction>
</CheckListItem>
);
Expand All @@ -1322,9 +1366,11 @@ function UploadedSourceFileWithCorrectDebugIdChecklistItem({
function UploadedSourceMapWithCorrectDebugIdChecklistItem({
sourceResolutionResults,
shouldValidate,
projectSlug,
}: {
shouldValidate: boolean;
sourceResolutionResults: FrameSourceMapDebuggerData;
projectSlug?: string;
}) {
const platform = getPlatform(sourceResolutionResults);
const sourceMapsDocLinks = getSourceMapsDocLinks(platform);
Expand All @@ -1345,21 +1391,16 @@ function UploadedSourceMapWithCorrectDebugIdChecklistItem({
<CheckListInstruction type="muted">
<h6>{t('No Source Map With Matching Debug ID')}</h6>
<p>
{tct(
"You already uploaded artifacts with Debug IDs but none of the uploaded source maps had a Debug ID matching this stack frame's Debug ID: [debugId]",
{
debugId: (
<MonoBlock>{sourceResolutionResults.stackFrameDebugId}</MonoBlock>
),
}
)}
<DebugIdMismatchMessage
projectSlug={projectSlug}
debugId={sourceResolutionResults.stackFrameDebugId}
/>
</p>
<p>
{t(
'Make sure to inject Debug IDs into all of your source files and to upload all of them to Sentry.'
)}
</p>
{/* TODO: Link to Uploaded Artifacts */}
</CheckListInstruction>
<SourceMapStepNotRequiredNote />
</CheckListItem>
Expand Down
Loading