Browse Source

fix(profiling) colno fallback (#66969)

Jonas 1 year ago
parent
commit
1e92eec456
2 changed files with 8 additions and 1 deletions
  1. 6 0
      static/app/types/profiling.d.ts
  2. 2 1
      static/app/utils/profiling/profile/utils.tsx

+ 6 - 0
static/app/types/profiling.d.ts

@@ -37,7 +37,11 @@ declare namespace Profiling {
 
   type SentrySampledProfileFrame = {
     in_app: boolean;
+    // These differ slightly from the speedscope schema, but just
+    // override them right now as we don't use the speedscope schema anymore
     colno?: number;
+    col?: number;
+    column?: number;
     filename?: string;
     function?: string;
     instruction_addr?: string;
@@ -140,6 +144,8 @@ declare namespace Profiling {
     path?: string;
     line?: number;
     column?: number;
+    col?: number;
+    colno?: number;
     is_application?: boolean;
     resource?: string;
     threadId?: number;

+ 2 - 1
static/app/utils/profiling/profile/utils.tsx

@@ -38,7 +38,7 @@ export function createSentrySampleProfileFrameIndex(
         package: frame.package,
         name: frame.function ?? 'unknown',
         line: frame.lineno,
-        column: frame.colno,
+        column: frame.colno ?? frame?.col ?? frame?.column,
         instructionAddr: frame.instruction_addr,
         symbol: frame.symbol,
         symbolAddr: frame.sym_addr,
@@ -88,6 +88,7 @@ export function createFrameIndex(
     acc[index] = new Frame(
       {
         key: index,
+        column: frame.colno ?? frame?.col ?? frame?.column,
         ...frame,
       },
       type