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

Upsert should not modify passed in data object #5136

Closed
5 tasks done
mpalmerlee opened this issue Jan 15, 2024 · 1 comment
Closed
5 tasks done

Upsert should not modify passed in data object #5136

mpalmerlee opened this issue Jan 15, 2024 · 1 comment

Comments

@mpalmerlee
Copy link

Describe the bug

If I call upsert using a javascript object (not an entity) the upsert method modifies the passed in object. It looks like this is caused by this line:

ChangeSetPersister.mapReturnedValues

Reproduction

mpalmerlee/mikro-orm-reproduction@a3590ef

What driver are you using?

@mikro-orm/postgresql

MikroORM version

@mikro-orm/core@6.0.5-dev.1

Node.js version

v20.5.0

Operating system

OSX

Validations

@mpalmerlee
Copy link
Author

Notice in the linked repro the data object now contains the id:

Screen Shot 2024-01-15 at 9 46 17 AM

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

No branches or pull requests

1 participant