demystifyfp / FsToolkit.ErrorHandling

An opinionated F# Library for error handling
https://demystifyfp.gitbook.io/fstoolkit-errorhandling
MIT License
462 stars 59 forks source link

Fix Using/TryFinally asyncValidation CE #271

Closed 1eyewonder closed 2 months ago

1eyewonder commented 2 months ago

Proposed Changes

Related to #270, I think we have some issues around our TryFinally/Using code. I have updated the CE to redirect calls to the necessary async functions to try to fix the related issues. I think the code was originally written this way because I was referencing the validation CE rather than also paying attention to things asyncResult was doing.

Types of changes

What types of changes does your code introduce to FsToolkit.ErrorHandling? Put an x in the boxes that apply and remove ones that don't apply

Checklist

Further comments

I am open to suggestions on additional unit tests we could potentially include to catch issues like this. I also added the #if !FABLE_COMPILER && NETSTANDARD2_1 conditional on a unit test since I noticed it was in asyncResult and not asyncValidation

1eyewonder commented 2 months ago

Evidence unit test changes passed prior to the CE changes. Per offline discussion with @TheAngryByrd, I'll try getting some additional unit tests spun up to help catch regression errors

image image

1eyewonder commented 2 months ago

Testing evidence of unit test failing in asyncValidation and passing in asyncResult on master branch image

Testing evidence of unit test passing in asyncValidation and passing in asyncResult on PR image

I also added these unit tests to the other async CE's to help catch any regression bugs