Commit 0b40afc
committed
LIBDRUM-909. Fix race condition in validation error display after deposit
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-9091 parent 5388c7b commit 0b40afc
File tree
2 files changed
+33
-0
lines changed- docs
- src/app/submission/sections/form
2 files changed
+33
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
370 | 370 | | |
371 | 371 | | |
372 | 372 | | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
373 | 387 | | |
374 | 388 | | |
375 | 389 | | |
| |||
0 commit comments