Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion static/app/components/stackTrace/frame/frameHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ function FrameLocation({
}) {
const {event} = useStackTraceFrameContext();
const frameDisplayPath = getFrameDisplayPath(frame, platform, event);
const frameLocationSuffix = formatFrameLocation('', frame.lineNo, frame.colNo);
const frameLocationSuffix = frame.inApp
? formatFrameLocation('', frame.lineNo, frame.colNo)
: '';

return (
<LocationWrapper>
Expand Down
28 changes: 28 additions & 0 deletions static/app/components/stackTrace/stackTrace.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,34 @@ describe('Core StackTrace', () => {
expect(screen.queryByText(':0:0')).not.toBeInTheDocument();
});

it('does not render line number for non-in-app frames', async () => {
const {event, stacktrace} = makeStackTraceData();
const frame = stacktrace.frames[stacktrace.frames.length - 1]!;

render(
<TestStackTraceProvider
event={event}
stacktrace={{
...stacktrace,
frames: [
{
...frame,
filename: 'library_internal.py',
lineNo: 42,
inApp: false,
},
],
}}
>
<StackTraceFrames frameContextComponent={FrameContent} />
</TestStackTraceProvider>
);

expect(await screen.findByText('library_internal.py')).toBeInTheDocument();
// Line number not shown for non-in-app frames
expect(screen.queryByText(/42/)).not.toBeInTheDocument();
});

it('falls back to raw function and renders trimmed package in title metadata', async () => {
const {event, stacktrace} = makeStackTraceData();
const frame = stacktrace.frames[stacktrace.frames.length - 1]!;
Expand Down
Loading