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

upsertMany does not function correctly in class-based entity stores #1083

Open
ZeevKatz opened this issue Apr 16, 2024 · 0 comments
Open

upsertMany does not function correctly in class-based entity stores #1083

ZeevKatz opened this issue Apr 16, 2024 · 0 comments

Comments

@ZeevKatz
Copy link

ZeevKatz commented Apr 16, 2024

Is this a regression?

No

Description

The updateEntities function is specifically designed to manage class-based entity stores also. It ensures that any entities updated are always instances of the appropriate class, by checking against both the previous and next object classes in the entity sequence (for more details, see this comment).

On the other hand, EntityStore.upsertMany employs a different update logic which does not automatically handle the class of the previous and next entities unless a class reference is explicitly provided in the options object. Notably, the paginator plugin relies on upsertMany to load new pages and does not offer the option to specify a class reference. This oversight leads to a conversion from class objects to plain objects when existing pages are reloaded, potentially causing data integrity issues.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in

No response

Anything else?

No response

Do you want to create a pull request?

Yes

@ZeevKatz ZeevKatz changed the title upsertMany does not handle class based entity store upsertMany does not function correctly in class-based entity stores Apr 16, 2024
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