Skip to content

feat(dashboards): don't retry W-ASAP validation errors in fetchWasapPageData - #1362

Merged
fhennig merged 3 commits into
mainfrom
no-retry-validation-errors
Jul 30, 2026
Merged

feat(dashboards): don't retry W-ASAP validation errors in fetchWasapPageData#1362
fhennig merged 3 commits into
mainfrom
no-retry-validation-errors

Conversation

@fhennig

@fhennig fhennig commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

#1349

Summary

Introduce WasapValidationError for config/state validation failures (mode not enabled, no collection selected, etc.) and tell React Query not to retry them, so the UI doesn't spin for ~7s on states that are immediately known to be invalid.

PR Checklist

  • All necessary documentation has been adapted.
  • The implemented feature is covered by an appropriate test.

Introduce WasapValidationError for config/state validation failures
(mode not enabled, no collection selected, etc.) and tell React Query
not to retry them, so the UI doesn't spin for ~7s on states that are
immediately known to be invalid.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dashboards Ready Ready Preview Jul 30, 2026 8:47am

Request Review

@fhennig
fhennig marked this pull request as ready for review July 29, 2026 13:37
@fhennig fhennig self-assigned this Jul 29, 2026
@fengelniederhammer fengelniederhammer linked an issue Jul 30, 2026 that may be closed by this pull request

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the W-ASAP page data loading behavior by distinguishing deterministic config/state validation failures from transient/network failures, so React Query can avoid unnecessary retries and the UI can surface invalid states immediately instead of “loading” for ~7 seconds.

Changes:

  • Introduces a WasapValidationError for deterministic W-ASAP validation failures (mode disabled, missing collection, missing variant, etc.).
  • Configures useWasapPageData’s React Query retry behavior to not retry WasapValidationErrors.
  • Updates unit tests to reflect the new error type.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
website/src/components/views/wasap/useWasapPageData.ts Adds WasapValidationError and updates query retry behavior + throws to use the typed validation error.
website/src/components/views/wasap/useWasapPageData.spec.ts Updates tests to expect the new validation error behavior.
Comments suppressed due to low confidence (6)

website/src/components/views/wasap/useWasapPageData.spec.ts:313

  • toThrow(new WasapValidationError(...)) only asserts the message, not that the rejection is actually a WasapValidationError. This test can pass even if a plain Error is thrown with the same message.
            ).rejects.toThrow(new WasapValidationError("Cannot fetch data, 'variant' mode is not enabled."));

website/src/components/views/wasap/useWasapPageData.spec.ts:414

  • toThrow(new WasapValidationError(...)) only asserts the message, not that the rejection is actually a WasapValidationError. This test can pass even if a plain Error is thrown with the same message.
            ).rejects.toThrow(new WasapValidationError("Cannot fetch data, 'untracked' mode is not enabled."));

website/src/components/views/wasap/useWasapPageData.spec.ts:563

  • toThrow(new WasapValidationError(...)) only asserts the message, not that the rejection is actually a WasapValidationError. This test can pass even if a plain Error is thrown with the same message.
            ).rejects.toThrow(
                new WasapValidationError("Cannot fetch data, 'covSpectrumCollection' mode is not enabled."),
            );

website/src/components/views/wasap/useWasapPageData.spec.ts:573

  • toThrow(new WasapValidationError(...)) only asserts the message, not that the rejection is actually a WasapValidationError. This test can pass even if a plain Error is thrown with the same message.
            ).rejects.toThrow(new WasapValidationError('No collection selected'));

website/src/components/views/wasap/useWasapPageData.spec.ts:943

  • toThrow(new WasapValidationError(...)) only asserts the message, not that the rejection is actually a WasapValidationError. This test can pass even if a plain Error is thrown with the same message.
            ).rejects.toThrow(new WasapValidationError("Cannot fetch data, 'collection' mode is not enabled."));

website/src/components/views/wasap/useWasapPageData.spec.ts:949

  • toThrow(new WasapValidationError(...)) only asserts the message, not that the rejection is actually a WasapValidationError. This test can pass even if a plain Error is thrown with the same message.
            ).rejects.toThrow(new WasapValidationError('No collection selected'));

Comment thread website/src/components/views/wasap/useWasapPageData.ts Outdated
Comment thread website/src/components/views/wasap/useWasapPageData.spec.ts Outdated
Felix Hennig and others added 2 commits July 30, 2026 10:41
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@fhennig
fhennig merged commit 063ab40 into main Jul 30, 2026
11 checks passed
@fhennig
fhennig deleted the no-retry-validation-errors branch July 30, 2026 08:55
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.

W-ASAP: don't retry validation errors in fetchWasapPageData

3 participants