Skip to content

fix: allow any numeric threshold for alerts (fixes #1589)#1742

Open
withabhinay wants to merge 1 commit intohyperdxio:mainfrom
withabhinay:main
Open

fix: allow any numeric threshold for alerts (fixes #1589)#1742
withabhinay wants to merge 1 commit intohyperdxio:mainfrom
withabhinay:main

Conversation

@withabhinay
Copy link

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.ts

    • Line 320: Changed z.number().int().min(1) to z.number()
    • Line 340: Changed z.number().positive() to z.number()
  • packages/api/src/utils/zod.ts

    • Line 203: Changed z.number().min(0) to z.number()
  • packages/app/src/DBSearchPageAlertModal.tsx

    • Line 58: Changed z.number().int().min(1) to z.number()

Testing

After these changes, alert thresholds now accept:

  • ✅ Negative values (e.g., -5, -10.5)
  • ✅ Zero (0)
  • ✅ Decimal/float values (e.g., 0.5, 2.75, 99.99)
  • ✅ Any numeric value

Related Issue

Closes #1589

@changeset-bot
Copy link

changeset-bot bot commented Feb 14, 2026

⚠️ No Changeset found

Latest commit: f38860b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Feb 14, 2026

@withabhinay is attempting to deploy a commit to the HyperDX Team on Vercel.

A member of the Team first needs to authorize it.

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.

Alerts should support any numeric threshold

1 participant