Skip to content

UIU-3463: Enhance AsyncValidateField to ensure debounced validation returns a Promise (follow-up).#3058

Merged
Dmytro-Melnyshyn merged 3 commits into
masterfrom
UIU-3463
Jul 8, 2026
Merged

UIU-3463: Enhance AsyncValidateField to ensure debounced validation returns a Promise (follow-up).#3058
Dmytro-Melnyshyn merged 3 commits into
masterfrom
UIU-3463

Conversation

@Dmytro-Melnyshyn

@Dmytro-Melnyshyn Dmytro-Melnyshyn commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Purpose

When entering a non-unique barcode/username, an inline error message should be displayed on the edit user page.

Description

Root cause
lodash/debounce doesn't return a Promise - since the debounce is trailing-edge, calling the debounced function returns undefined synchronously (the actual validate() call only happens after the wait timer fires, long after the wrapper has already returned).

Approach

Wrap the debounce so every call to the outer function returns a genuine Promise that resolves once the debounced/delayed call actually runs (the standard pattern used in the final-form async-validation recipes).

Issues

https://folio-org.atlassian.net/browse/UIU-3463

TODOS and Open Questions

Learning

Pre-Merge Checklist

Before merging this PR, please go through the following list and take appropriate actions.

  • I've added appropriate record to the CHANGELOG.md
  • Does this PR meet or exceed the expected quality standards?
    • Code coverage on new code is 80% or greater
    • Duplications on new code is 3% or less
    • There are no major code smells or security issues
  • Does this introduce breaking changes?
    • If any API-related changes - okapi interfaces and permissions are reviewed/changed correspondingly
    • There are no breaking changes in this PR.

If there are breaking changes, please STOP and consider the following:

  • What other modules will these changes impact?
  • Do JIRAs exist to update the impacted modules?
    • If not, please create them
    • Do they contain the appropriate level of detail? Which endpoints/schemas changed, etc.
    • Do they have all they appropriate links to blocked/related issues?
  • Are the JIRAs under active development?
    • If not, contact the project's PO and make sure they're aware of the urgency.
  • Do PRs exist for these changes?
    • If so, have they been approved?

Ideally all of the PRs involved in breaking changes would be merged in the same day to avoid breaking the folio-testing environment. Communication is paramount if that is to be achieved, especially as the number of intermodule and inter-team dependencies increase.

While it's helpful for reviewers to help identify potential problems, ensuring that it's safe to merge is ultimately the responsibility of the PR assignee.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

Jest Unit Test Results

    1 files  ±0    290 suites  ±0   5m 46s ⏱️ +12s
1 517 tests +3  1 514 ✅ +3  3 💤 ±0  0 ❌ ±0 
1 553 runs  +3  1 550 ✅ +3  3 💤 ±0  0 ❌ ±0 

Results for commit 06a2c45. ± Comparison against base commit ab1e6a7.

♻️ This comment has been updated with latest results.

@Dmytro-Melnyshyn
Dmytro-Melnyshyn requested a review from a team July 8, 2026 08:13
@sonarqubecloud

sonarqubecloud Bot commented Jul 8, 2026

Copy link
Copy Markdown

@Dmytro-Melnyshyn
Dmytro-Melnyshyn requested a review from a team July 8, 2026 08:18
@Dmytro-Melnyshyn
Dmytro-Melnyshyn merged commit 4224448 into master Jul 8, 2026
16 checks passed
@Dmytro-Melnyshyn
Dmytro-Melnyshyn deleted the UIU-3463 branch July 8, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants