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

RCORE-2115 Fix multiple backlinks created by dictionary #7677

Merged
merged 2 commits into from
May 6, 2024

Conversation

ironage
Copy link
Contributor

@ironage ironage commented May 3, 2024

Fixes #7676
This regression was caused by #7523

I couldn't cause any hard crashes or exceptions so it is hard to say that this has been observed outside of niche query cases.
This is because we have previously chosen to ignore nullifying backlinks that point to an object that no longer exists, since #6638

☑️ ToDos

  • 📝 Changelog update
  • 🚦 Tests (or not relevant)
  • C-API, if public C++ API changed
  • bindgen/spec.yml, if public C++ API changed

@ironage ironage requested review from jedelbo and danieltabacaru May 3, 2024 18:08
@ironage ironage self-assigned this May 3, 2024
@cla-bot cla-bot bot added the cla: yes label May 3, 2024
Copy link
Collaborator

@danieltabacaru danieltabacaru left a comment

Choose a reason for hiding this comment

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

Nice catch!

CHANGELOG.md Outdated
@@ -7,6 +7,7 @@
### Fixed
* <How do the end-user experience this issue? what was the impact?> ([#????](https://github.com/realm/realm-core/issues/????), since v?.?.?)
* Accessing App::current_user() from within a notification produced by App:switch_user() (which includes notifications for a newly logged in user) would deadlock ([#7670](https://github.com/realm/realm-core/issues/7670), since v14.6.0).
* Inserting the same typed link to the same key in a dictionary more than once would incorrectly create multiple backlinks to the object. This did not appear to cause any crashes later, but would have affecting explicit backlink count queries o@links.@count`) and possibly notifications ([#7676](https://github.com/realm/realm-core/issues/7676) since v14.5.2).
Copy link
Collaborator

Choose a reason for hiding this comment

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

did you mean to have ` before o@links.@count?

Copy link

Pull Request Test Coverage Report for Build james.stone_540

Details

  • 8 of 8 (100.0%) changed or added relevant lines in 2 files are covered.
  • 56 unchanged lines in 12 files lost coverage.
  • Overall coverage decreased (-0.006%) to 90.748%

Files with Coverage Reduction New Missed Lines %
src/realm/index_string.hpp 1 93.48%
src/realm/query_engine.hpp 1 94.11%
src/realm/sync/noinst/server/server.cpp 1 74.22%
test/test_query2.cpp 1 98.73%
src/realm/array_blobs_big.cpp 2 98.58%
src/realm/object-store/shared_realm.cpp 2 91.89%
src/realm/table.cpp 3 90.08%
test/test_thread.cpp 3 64.84%
src/realm/alloc_slab.cpp 4 90.81%
src/realm/sync/noinst/client_impl_base.cpp 10 82.48%
Totals Coverage Status
Change from base Build 2290: -0.006%
Covered Lines: 212535
Relevant Lines: 234203

💛 - Coveralls

Copy link
Contributor

@jedelbo jedelbo left a comment

Choose a reason for hiding this comment

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

Damn. I am sure I had this in mind when making the change. We recently had this issue: #7384. Anyway - shit happens. Thank you for fixing this.

@jedelbo jedelbo merged commit f72158f into master May 6, 2024
8 checks passed
@jedelbo jedelbo deleted the js/dict-key-links branch May 6, 2024 08:04
jedelbo pushed a commit that referenced this pull request May 6, 2024
* fix inserting a link multiple times to the same key in a dictionary of mixed creating multiple backlinks
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dictionary of mixed with links can create multiple backlinks
3 participants