Closed llecorguille closed 2 years ago
Is it related to the "fake async" support ? (docs)
Fake async is using Promise.resolve()
to schedule the task as a microtask, which should work correctly. I'll look into this. Thanks!
Well, turns out this has never worked correctly. I'll be investigating this further. But it's gonna be slow as I'm a bit busy these days.
With Mapper#map
it should outputs 1,2,4,3
while with Mapper#mapAsync
it should outputs 1,2,3,4
@llecorguille?
With
Mapper#map
it should outputs1,2,4,3
while withMapper#mapAsync
it should outputs1,2,3,4
@llecorguille?
Yes, that's it. But currently the Mapper#mapAsync
outputs 1,2,4,3
This specific issue has been addressed with AutoMapper v8. However, the TRUE underlying issue with "Fake" async is still there. Complex async flow with AutoMapper isn't recommended for now. If you have a complex async flow to map from one object to another, do not use AutoMapper for that object pairs.
Describe the bug Hello everyone, I am struggling with the mapAsync function. I am trying to map a sync source to a async destination The mapAsync function is not waiting the afterMap function to complete before resolving the promise.
Models/DTOs
I want to map a "IdOnlyDto" class to a "Dalle" class. The Dalle class is a sequelize model.
Mapping Configuration
Test
Expected behavior Output : 1,2,3,4
Actual behavior Output : 1,2,4,3