Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(insights): Don't allow annotations overlay to crash insight #21217

Merged
merged 1 commit into from
Mar 28, 2024
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: 2 additions & 2 deletions frontend/src/layout/ErrorBoundary/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export function ErrorBoundary({ children }: { children: React.ReactElement }): J
)}
</code>
</pre>
{isSentryInitialized
{isSentryInitialized && eventId?.match(/[^0]/)
? `We've registered this event for analysis (ID ${eventId}), but feel free to contact us directly too.`
: 'Please send over a screenshot of this message, so that we can resolve the issue.'}
: 'Please help us resolve the issue by sending a screenshot of this message.'}
<HelpButton
customComponent={
<LemonButton type="primary" sideIcon={<IconChevronDown />}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ export function useAnnotationsPositioning(
const points = chart._metasets[0].data as Point[]
const firstTickPointIndex = chart.scales.x.ticks[0].value
const lastTickPointIndex = chart.scales.x.ticks[tickCount - 1].value
const firstTickLeftPx = points[firstTickPointIndex].x
const lastTickLeftPx = points[lastTickPointIndex].x
// Fall back to zero for resiliency against temporary chart inconsistencies during loading
const firstTickLeftPx = points[firstTickPointIndex]?.x ?? 0
const lastTickLeftPx = points[lastTickPointIndex]?.x ?? 0
return {
tickIntervalPx: (lastTickLeftPx - firstTickLeftPx) / (tickCount - 1),
firstTickLeftPx,
Expand Down
Loading