Async Validation via Sequence is Failing.
See original GitHub issueI ran into this today and thought is was my dummy self 😉
Here’s a repro test that shows turning a Success<string, Task<int>>
into a Task<Fail<string, int>>
where I fully expect Task<Success<string,int>>
.
[Fact]
async Task async_validation_via_sequence()
{
Task<Validation<string, int>> validation =
Success<string, int>(1)
.Map(x => (x * 2).AsTask())
.Sequence();
var result = await validation;
Assert.False(result.IsFail);
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Async custom validation causes an error to the console
Async custom validation causes an error to the console: "Cannot read property 'required' of null at Object. eval [as updateDirectives]" So, why ...
Read more >Message validation in async messaging-based services
This is logic that checks for things like missing/null fields, values outside of certain ranges, bad formatting, etc.
Read more >Async validator must return a Promise or Observable
Async validators must return a promise or an observable, and emit/resolve them whether the validation fails or succeeds. In particular, they must implement ......
Read more >Using Custom Async Validators with Angular
While we got the async validation working like a charm, we had another problem: The error messages weren't updating in the view. At...
Read more >Async validator
This rule was created to prevent long asynchronous validation sequences. ... Async validator. Type name John to fail validation. Validation will take 2 ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Indeed. Here is a slightly shorter MWE.
@louthy may I ask why this issue was just closed without any solution/workaround? Should we watch #876 instead?
In the meantime, the workaround with
Match
(actuallyMatchAsync
) that @trbngr mentioned looks like this: