Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: stop revalidating with stale values #8193

Merged
merged 2 commits into from
Dec 24, 2024
Merged

Conversation

Zangetsu101
Copy link
Collaborator

No description provided.

Copy link

Oops! Looks like you forgot to update the changelog. When updating CHANGELOG.md, please consider the following:

  • Changelog is read by country implementors who might not always be familiar with all technical details of OpenCRVS. Keep language high-level, user friendly and avoid technical references to internals.
  • Answer "What's new?", "Why was the change made?" and "Why should I care?" for each change.
  • If it's a breaking change, include a migration guide answering "What do I need to do to upgrade?".

@euanmillar euanmillar modified the milestones: v1.6.1, v1.6.2 Dec 11, 2024
Comment on lines +287 to 288
setFieldTouched(fieldDefinition.name, true, false)
setFieldValue(fieldDefinition.name, files)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good fix and a good comment. Just to understand the issue, as setFieldValue and setFieldTouched are promises, would one fix also be to await for the setFieldValue and then setFieldTouched, or why does setFieldTouched have stale values?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My guess is that if your validate function was asynchronous then promises would have come into play

@Zangetsu101 Zangetsu101 changed the title fix: only revalidate with updated values fix: stop revalidating with stale values Dec 17, 2024
@Zangetsu101 Zangetsu101 enabled auto-merge (squash) December 23, 2024 09:23
@Zangetsu101 Zangetsu101 merged commit 15efb5f into develop Dec 24, 2024
31 of 32 checks passed
@Zangetsu101 Zangetsu101 deleted the fix-formik-validation branch December 24, 2024 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants