mirror of
https://github.com/hyperdxio/hyperdx
synced 2026-04-21 13:37:15 +00:00
## Summary Source validation toasts were emitted from `useSources()` on every query refresh for each invalid source, and each notification had no stable `id`. Because the notifications are persistent (`autoClose: false`), repeated refreshes stacked many identical toasts and made the Sources form hard to use. This change adds deterministic toast IDs per source validation error so repeated emissions update the same toast instead of creating duplicates. - Added `getSourceValidationNotificationId(sourceId)` in `source.ts` - Updated source validation notifications in `useSources()` to pass `id` - Added a unit regression test that executes the query function twice and verifies the same notification `id` is reused - Added a patch changeset for `@hyperdx/app` ### Screenshots or video [hdx_3908_validation_toast_dedupe_demo.mp4](https://cursor.com/agents/bc-28804425-1ca7-4133-91d8-94acfd659f05/artifacts?path=%2Fopt%2Fcursor%2Fartifacts%2Fhdx_3908_validation_toast_dedupe_demo.mp4) [Single source validation toast after repeated refreshes](https://cursor.com/agents/bc-28804425-1ca7-4133-91d8-94acfd659f05/artifacts?path=%2Fopt%2Fcursor%2Fartifacts%2Fhdx_3908_single_validation_toast_after_refreshes.webp) ### How to test locally or on Vercel 1. Run `yarn ci:unit src/__tests__/source.test.ts` inside `packages/app`. 2. Confirm `useSources validation notifications` test passes. 3. Open Team Settings → Sources with an invalid source and refresh repeatedly; verify only one validation toast remains visible per source. ### References - Linear Issue: HDX-3908 - Related PRs: none <sub>To show artifacts inline, <a href="https://cursor.com/dashboard/cloud-agents#team-pull-requests">enable</a> in settings.</sub> <div><a href="https://cursor.com/agents/bc-28804425-1ca7-4133-91d8-94acfd659f05"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a> <a href="https://cursor.com/background-agent?bcId=bc-28804425-1ca7-4133-91d8-94acfd659f05"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a> </div> Co-authored-by: Cursor Agent <199161495+cursoragent@users.noreply.github.com>
159 B
159 B
| @hyperdx/app |
|---|
| patch |
Dedupe source validation issue toasts so repeated source refetches update a single notification instead of stacking duplicates.