LIBDRUM-909. Fix race condition in validation error display after deposit#100
Merged
dsteelma-umd merged 1 commit intodrum-mainfrom Apr 20, 2026
Merged
LIBDRUM-909. Fix race condition in validation error display after deposit#100dsteelma-umd merged 1 commit intodrum-mainfrom
dsteelma-umd merged 1 commit intodrum-mainfrom
Conversation
313e60a to
feabece
Compare
ded240c to
0b40afc
Compare
…osit When depositing with missing required fields, the backend returns errors that trigger a form re-initialization via hasMetadataEnrichment(). This causes checksForErrors() to be called multiple times concurrently. The first call correctly marks form controls as touched, but initForm() then rebuilds the controls, wiping their touched state. The second call is skipped by the isEqual() guard in checkSectionErrors() because this.sectionData.errorsToShow was already updated by the first call, so markAsTouched() is never re-applied to the rebuilt controls. This fix resets this.sectionData.errorsToShow to [] before calling initForm() in the hasMetadataEnrichment branch of updateForm(), so the second checksForErrors() call treats the errors as new and re-applies them to the rebuilt form controls. Co-authored-by: Perplexity AI <noreply@perplexity.ai> https://umd-dit.atlassian.net/browse/LIBDRUM-909
0b40afc to
a07c826
Compare
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.
When depositing with missing required fields, the backend returns errors
that trigger a form re-initialization via hasMetadataEnrichment(). This
causes checksForErrors() to be called multiple times concurrently. The
first call correctly marks form controls as touched, but initForm()
then rebuilds the controls, wiping their touched state. The second call
is skipped by the isEqual() guard in checkSectionErrors() because
this.sectionData.errorsToShow was already updated by the first call,
so markAsTouched() is never re-applied to the rebuilt controls.
This fix resets this.sectionData.errorsToShow to [] before calling
initForm() in the hasMetadataEnrichment branch of updateForm(), so the
second checksForErrors() call treats the errors as new and re-applies
them to the rebuilt form controls.
Co-authored-by: Perplexity AI noreply@perplexity.ai
https://umd-dit.atlassian.net/browse/LIBDRUM-909