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(experiments): Prevent crash when sharedMetrics isn't loaded #28663

Merged
merged 2 commits into from
Feb 13, 2025

Conversation

danielbachhuber
Copy link
Contributor

Merges into #28347

Changes

Prevents 'cannot filter null' error when sharedMetrics isn't yet loaded.

How did you test this code?

Manual review.

@danielbachhuber danielbachhuber requested a review from a team February 13, 2025 13:23
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This PR adds a defensive null check in the experiments feature to prevent runtime crashes when shared metrics data hasn't loaded yet.

  • Added null check for sharedMetrics in frontend/src/scenes/experiments/experimentLogic.tsx to prevent "cannot filter null" error
  • Ensures graceful handling when shared metrics data is still loading or unavailable
  • Maintains compatibility with existing shared metrics functionality while improving error handling

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

4 snapshot changes in total. 0 added, 4 modified, 0 deleted:

  • chromium: 0 added, 4 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@danielbachhuber danielbachhuber merged commit 7a01626 into init-new-experiment-query-runner Feb 13, 2025
98 of 99 checks passed
@danielbachhuber danielbachhuber deleted the prevent-crash branch February 13, 2025 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants