Skip to content

Commit 124cf1d

Browse files
committed
Restore correct stack substitution code.
We need to replace cause.stack even if convertStack returned null, otherwise we have bad stack indexes sticking around. The incorrect `if (stack)` was added during the TypeScript migration in commit ed02f3f. This restores the logic as it was before the migration.
1 parent 86ff177 commit 124cf1d

File tree

1 file changed

+16
-22
lines changed

1 file changed

+16
-22
lines changed

src/profile-logic/profile-data.ts

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2465,17 +2465,14 @@ export function updateThreadStacks(
24652465
oldData: MarkerPayload | null
24662466
): MarkerPayload | null {
24672467
if (oldData && 'cause' in oldData && oldData.cause) {
2468-
const stack = convertStack(oldData.cause.stack);
2469-
if (stack) {
2470-
// Replace the cause with the right stack index.
2471-
return {
2472-
...oldData,
2473-
cause: {
2474-
...oldData.cause,
2475-
stack,
2476-
},
2477-
};
2478-
}
2468+
// Replace the cause with the right stack index.
2469+
return {
2470+
...oldData,
2471+
cause: {
2472+
...oldData.cause,
2473+
stack: convertStack(oldData.cause.stack),
2474+
},
2475+
};
24792476
}
24802477
return oldData;
24812478
}
@@ -2536,17 +2533,14 @@ export function updateRawThreadStacksSeparate(
25362533
oldData: MarkerPayload | null
25372534
): MarkerPayload | null {
25382535
if (oldData && 'cause' in oldData && oldData.cause) {
2539-
const stack = convertSyncBacktraceStack(oldData.cause.stack);
2540-
if (stack) {
2541-
// Replace the cause with the right stack index.
2542-
return {
2543-
...oldData,
2544-
cause: {
2545-
...oldData.cause,
2546-
stack,
2547-
},
2548-
};
2549-
}
2536+
// Replace the cause with the right stack index.
2537+
return {
2538+
...oldData,
2539+
cause: {
2540+
...oldData.cause,
2541+
stack: convertSyncBacktraceStack(oldData.cause.stack),
2542+
},
2543+
};
25502544
}
25512545
return oldData;
25522546
}

0 commit comments

Comments
 (0)