Skip to content

fix(web): update form validation on in-flight requests and migrate to signals - #907

Merged
kyasbal merged 2 commits into
GoogleCloudPlatform:mainfrom
kyasbal:push-yvtsvpkswswm
Aug 26, 2026
Merged

kyasbal merged 2 commits into
GoogleCloudPlatform:mainfrom
kyasbal:push-yvtsvpkswswm

Conversation

@kyasbal

@kyasbal kyasbal commented Aug 26, 2026

Copy link
Copy Markdown
Member

Summary

Resolves an issue where user input during in-flight dryrun requests in the new-inspection dialog prevented form validation states from updating.

  • Implements a sequential completion-driven dryrun loop in NewInspectionDialogComponent that checks whether parameters changed during flight.
  • If parameters changed while a request was in flight, the stale response is discarded and an immediate re-validation dryrun is dispatched with the latest inputs without waiting for the polling delay.
  • Migrates ParameterStore from RxJS subjects to Angular Signals (signal(), computed()), removing legacy watchers (watch, watchDirty, watchAll).
  • Introduces areValuesEqual deep value equality helper in ParameterStore so array parameters (SetParameter) and Date objects compare by value rather than reference equality, preventing fields from endlessly remaining in the validating state.
  • Accurately tracks validation lifecycle for remote-assigned default values, keeping fields in validating state until the subsequent dryrun actually validates them.
  • Protects TextParameterComponent inputs from being overwritten by completed background dryruns while focused, and stages input locally when validationTiming === Blur.
  • Displays a small spinner next to form field titles while validation is in-flight.

Verification

  • make test-web (784 tests pass)
  • make pre-commit (linters, formatters, and style checkers pass cleanly with 0 issues)
… signals

Resolve an issue where user input during in-flight dryrun requests in the
new inspection dialog prevented form validation states from updating.

- Implement a sequential completion-driven dryrun loop with stale response
  invalidation and immediate re-validation on input change.
- Migrate ParameterStore to Angular Signals, removing legacy RxJS watchers.
- Support deep/array value equality comparison in ParameterStore to prevent
  array-based fields from endlessly remaining in the validating state.
- Keep fields in validating state while assigned default values are being
  validated by the subsequent dryrun.
- Protect TextParameter inputs from background dryrun overwrites while focused
  and stage blur-validated fields locally until blur.
- Display a small spinner next to form field titles during validation.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request refactors the parameter management system in the new inspection dialog, transitioning from RxJS observables to Angular Signals. Key changes include updating the ParameterStore to use signals, refactoring components (ParameterHeader, SetParameter, and TextParameter) to consume these signals, and implementing a sequential dryrun loop using an AbortController in NewInspectionDialogComponent. Feedback focuses on optimizing signal creation by caching computed signals in the store, ensuring in-flight dryrun HTTP requests are properly cancelled upon abort, and refining the delay helper to handle pre-aborted signals and propagate cancellation using a custom CancellationError.

@kyasbal kyasbal added the type:bug Something isn't working as expected label Aug 26, 2026
…ellation

- Cache computed signals in DefaultParameterStore per parameter ID to avoid
  allocating new signal nodes on every getter access.
- Clear cached signals upon store destruction.
- Pipe in-flight dryrunDirect requests through takeUntil(fromEvent(signal, 'abort'))
  to cancel active HTTP requests immediately upon loop abort.
- Check signal.aborted at the beginning of delay() and reject with CancellationError.
- Handle CancellationError and abort cleanly in startDryrunLoop without leaked promises.
@kyasbal
kyasbal merged commit cf939f2 into GoogleCloudPlatform:main Aug 26, 2026
16 checks passed
@kyasbal
kyasbal deleted the push-yvtsvpkswswm branch August 26, 2026 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Something isn't working as expected

1 participant