getsentry/spotlight

Span waterfall displayed incorrectly on Firefox

Closed this issue · 2 comments

Screenshot 2023-12-11 at 11 29 31

left is Firefox, right is Safari

There might be an issue in Firefox, displaying the span waterfall wrong.

Screenshot 2023-12-11 at 11 28 03

Sentry UI for reference.

Interesting - I didnt think we resorted any of the spans (or at least not intentionally)

just checked the span listing in overlay and found this line of code where we are sorting spans-

const sortedSpans = [...spans] .sort(a => (a.parent_span_id ? 1 : 0));

Although the original compare function is acceptable, it could lead to varied results in different browsers. According to conventions, the sort compare function should compare two values, yielding a positive, negative, or zero result.

After making this adjustment to the code, it appears that the results are now consistent across different browsers.