fix: allow any numeric threshold for alerts (fixes #1589)#1742
Open
withabhinay wants to merge 1 commit intohyperdxio:mainfrom
Open
fix: allow any numeric threshold for alerts (fixes #1589)#1742withabhinay wants to merge 1 commit intohyperdxio:mainfrom
withabhinay wants to merge 1 commit intohyperdxio:mainfrom
Conversation
|
|
@withabhinay is attempting to deploy a commit to the HyperDX Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #1589
This PR removes the restrictive validation on alert thresholds to allow any numeric value including negative numbers, zero, and decimal values.
Previously, the Zod schema validation required thresholds to be either integers greater than or equal to 1, or positive numbers depending on the context. This prevented users from setting alerts for negative values, zero, or decimal thresholds.
Changes
Updated Zod schema validation in three files:
packages/common-utils/src/types.tsz.number().int().min(1)toz.number()z.number().positive()toz.number()packages/api/src/utils/zod.tsz.number().min(0)toz.number()packages/app/src/DBSearchPageAlertModal.tsxz.number().int().min(1)toz.number()Testing
After these changes, alert thresholds now accept:
-5,-10.5)0)0.5,2.75,99.99)Related Issue
Closes #1589