Closed exalate-issue-sync[bot] closed 2 days ago
Sasha Dresden commented: I dug into this code and it’s due to the way asynchronous validation is being handled for the committee_fec_id field. It’s essentially getting triggered multiple times due to the way angular form updates are handled. However, there is a simple fix! You tell it to only run when value changes are explicitly provided. Essentially, telling it to only run when the form is dirty, which would not be the case when it is simply being populated.
In the ContactService.getFecIdValidator() function, you can add the following to the top of the returned function
{noformat}if (!control.dirty) { return of(null); }{noformat}
I tested this locally and it prevented the large spike of requests that happen when the form gets populated via committee selection/creation, but still allows the validator to run when you manually attempt to change the value after the fact.
There are not code changes for this ticket so sending straight to QA. A follow on ticket was created for the actual work: [https://fecgov.atlassian.net/browse/FECFILE-1523|https://fecgov.atlassian.net/browse/FECFILE-1523|smart-link]
There are no code changes for this SPIKE.
Not reviewed by QA. Moved to Stage Ready.
Automation for Jira commented: Sprint accepted by Paul Clark at Sprint Review on comment date.
When investigating external connections from FECFile Online, Laura noticed that the contacts/get_contact_id/ ran numerous times on committee lookup when creating a new committee contact. This might be because of the type-ahead functionality. The purpose of this ticket is to:
example of requests (to produce this there was no typing in the search bar, so i’s likely not related to the typeahead):
[!Untitled.png!| /attachments/11590?name=Untitled.png]
TIMEBIOX to 4 hours
QA Notes
null
DEV Notes
Potential solutions can include running the lookup every few characters with the type-ahead functionality, or debouncing
Design
null
See full ticket and images here: FECFILE-1507