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

Setter must replace embedded object instead of add a new object #6242

Merged
merged 2 commits into from
Nov 17, 2023

Conversation

kneth
Copy link
Contributor

@kneth kneth commented Nov 10, 2023

What, How & Why?

When replacing an element in a list of embedded object, the existing object should be removed. Calling Obj::set_embedded() is replacing while Obj::insert_embedded() will create a new object and add it to the list without touching the existing element.

This closes #6239

☑️ ToDos

  • 📝 Changelog entry
  • 📝 Compatibility label is updated or copied from previous entry
  • 📝 Update COMPATIBILITY.md
  • 🚦 Tests
  • 📦 Updated internal package version in consuming package.jsons (if updating internal packages)
  • 📱 Check the React Native/other sample apps work if necessary
  • 💥 Breaking label has been applied or is not necessary

Copy link

coveralls-official bot commented Nov 10, 2023

Coverage Status

coverage: 86.24% (+0.05%) from 86.187%
when pulling ed2d271 on kneth/embedded-object-behavior
into cc63892 on main.

Copy link
Contributor

@elle-j elle-j left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good and important fix!

CHANGELOG.md Show resolved Hide resolved
integration-tests/tests/src/tests/list.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@takameyer takameyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, good fix!

@kneth kneth force-pushed the kneth/embedded-object-behavior branch from b46ea88 to ed2d271 Compare November 16, 2023 09:22
@kneth kneth merged commit 6dcc3b1 into main Nov 17, 2023
32 checks passed
@kneth kneth deleted the kneth/embedded-object-behavior branch November 17, 2023 09:11
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Updating an element within an array of embedded schema behaves differently on Realm 12 and 11
3 participants