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

Critical regression introduced in Mapster 7.3.0 when mapping to existing objects #537

Open
andrerav opened this issue Feb 7, 2023 · 6 comments
Assignees
Labels

Comments

@andrerav
Copy link
Contributor

andrerav commented Feb 7, 2023

There are numerous issues that have been reported since the release of 7.3.0 that seem to have a common theme -- performing a map to an existing object has a tendency to create a new object instance instead of preserving the instance being mapped. So far it seems that the following issues have reported this:

Other possibly related issues:

I'm working on investigating which chance in 7.3.0 that might have introduced this issue. I will update this issue when I have new information to share.

@satano
Copy link
Member

satano commented Apr 15, 2023

Hello.

In this case, should not be version 7.3.0 marked as deprecated because of critical bugs in nuget.org?

@doddgu
Copy link

doddgu commented Jul 4, 2023

hi, is there any progress?

@DocSvartz
Copy link

DocSvartz commented Sep 22, 2023

Hello, new instanse always created if TDestination does not have a public constructor without parameters. Maybe this has something to do with the problem.
In this case RecordTypeAdapter is selected for Class

Class is detected as Record in

public static bool IsRecordType(this Type type)

@andrerav
Copy link
Contributor Author

Thanks to @DocSvartz this issue has been partially fixed. See #634 for details.

@DocSvartz
Copy link

DocSvartz commented Oct 23, 2023

Hello @andrerav , have you had problems with dictionaries ?
The generic KeyValuePair has always been detect as a record.
when updating you always received new instanse KeyValuePair and include member if then has been detect as record
new KeyValuePair<FakeRecordKey,FakeRecordValue> (New _Key, new _Value)

@DocSvartz
Copy link

@andrerav I open PR #646 When 2 Step of Fixing this problemm :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants