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: add limit 1 to validation tries #1761

Merged
merged 1 commit into from
Dec 24, 2023

Conversation

MohamedElmdary
Copy link
Member

Description

While working with useAsync I notice that validation is done 3 times (if valid) which not bad in case a user have bad connection but too bad if task takes long time

Changes

limit tries to 1 to validation tasks

Related Issues

Checklist

  • Tests included
  • Build pass
  • Documentation
  • Code format and docstrings
  • Screenshots/Video attached (needed for UI changes)

Copy link
Contributor

@zaelgohary zaelgohary left a comment

Choose a reason for hiding this comment

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

Do we still need this check?

tries: typeof options.tries !== "number" ? 3 : Math.max(1, options.tries),

@MohamedElmdary
Copy link
Member Author

Do we still need this check?

tries: typeof options.tries !== "number" ? 3 : Math.max(1, options.tries),

It should be fine to keep the check as someone might pass a wrong value e.g -1

@MohamedElmdary MohamedElmdary merged commit ebf75a3 into development Dec 24, 2023
3 checks passed
@MohamedElmdary MohamedElmdary deleted the development_limit_validation_tries branch December 24, 2023 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants