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

retryCondition should use promise value in return #196

Merged
merged 3 commits into from
Apr 29, 2022

Conversation

PeterChen1997
Copy link
Contributor

@PeterChen1997 PeterChen1997 commented Apr 14, 2022

I think it's better to get the control back to user, it's more flexible

@YangChen00
Copy link

@mindhells plz have a look, thx

@mindhells
Copy link
Member

you'd need to fix the tests
can you please give a little more context?

@PeterChen1997
Copy link
Contributor Author

The condition is that i want use Promise to control the retry result, instead of use throw error in it. It's not handy

@PeterChen1997
Copy link
Contributor Author

The test i will have a look

@PeterChen1997
Copy link
Contributor Author

solved, plz have a look again @mindhells

@mindhells
Copy link
Member

I believe this relates to #190

I missing 2 things to merge this PR:

  • update the docs to note retryCondition should return a boolean
  • don't change behavior for those using a retryCondition that just doesn't throw: this would mean return true unless await shouldRetryOrPromise === false

WDYT?

@mindhells mindhells linked an issue Apr 25, 2022 that may be closed by this pull request
@PeterChen1997
Copy link
Contributor Author

Got it, i will have a look on it

@PeterChen1997
Copy link
Contributor Author

@mindhells Done, have i got the point?

@mindhells
Copy link
Member

@mindhells Done, have i got the point?

Yes! I think so
thanks a lot
I'm going to merge a create a new release

@mindhells mindhells merged commit eef7f2d into softonic:master Apr 29, 2022
@mindhells
Copy link
Member

v3.2.5 published!

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.

isNetworkOrIdempotentRequestError should return boolean
3 participants