Skip to content

fix: add safety check to check if anomaly rule in uplot chart options #6343

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

Merged
merged 1 commit into from
Nov 1, 2024

Conversation

YounixM
Copy link
Member

@YounixM YounixM commented Nov 1, 2024

https://signoz-io.sentry.io/issues/6034450498/?alert_rule_id=15272042&alert_type=issue&project=4506831143763968


Important

Add safety check for isAnomaly property in getUplotChartOptions to prevent undefined errors.

  • Behavior:
    • Add safety check for isAnomaly property in getUplotChartOptions in getUplotChartOptions.ts to default to false if undefined.

This description was created by Ellipsis for c9a0d6c. It will automatically update as commits are pushed.

@github-actions github-actions bot added the bug Something isn't working label Nov 1, 2024
Copy link

github-actions bot commented Nov 1, 2024

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

1 similar comment
Copy link

github-actions bot commented Nov 1, 2024

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to c9a0d6c in 16 seconds

More details
  • Looked at 14 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. frontend/src/lib/uPlotLib/getUplotChartOptions.ts:167
  • Draft comment:
    Good use of optional chaining and default value to prevent runtime errors when accessing isAnomaly.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The change made in the PR is a safety check to ensure that isAnomaly is accessed safely. This is a good practice to prevent runtime errors when the data structure is not as expected.
2. frontend/src/lib/uPlotLib/getUplotChartOptions.ts:167
  • Draft comment:
    Use design tokens or predefined color constants instead of hardcoding 'red'. This applies to other hardcoded colors like 'white' and '#fff' as well.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_5IlZKgssaIFrrXmX


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@YounixM YounixM merged commit 4978fb9 into develop Nov 1, 2024
11 of 14 checks passed
@YounixM YounixM deleted the fix/add-safety-check-uplot-options branch November 1, 2024 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants