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

[v6] Cache Realm instances #3322

Merged
merged 1 commit into from
Oct 12, 2020
Merged

[v6] Cache Realm instances #3322

merged 1 commit into from
Oct 12, 2020

Conversation

kneth
Copy link
Contributor

@kneth kneth commented Oct 9, 2020

What, How & Why?

The introduction of Realm Core v6, Realm Object Store changed disabled the caching of Realm instances.

Currently: https://github.com/realm/realm-object-store/blob/301642fe90212c379f550656a7234f41db158ddf/src/shared_realm.hpp#L235
Pre Core v6: https://github.com/realm/realm-object-store/blob/5d8bfcac9804962945d47530f372c6f8dee77416/src/shared_realm.hpp#L234

By disabling caching, user might see growing Realm files when they forgot to call Realm.close().

☑️ ToDos

  • 📝 Changelog entry
  • [ ] 📝 Compatibility label is updated or copied from previous entry
  • 🚦 Tests
  • [ ] 📝 Public documentation PR created or is not necessary
  • [ ] 💥 Breaking label has been applied or is not necessary

If this PR adds or changes public API's:

  • [ ] typescript definitions file is updated
  • [ ] jsdoc files updated
  • [ ] Chrome debug API is updated if API is available on React Native

@kneth kneth changed the title Cache Realm instances [v6] Cache Realm instances Oct 9, 2020
@kneth kneth self-assigned this Oct 9, 2020
Copy link
Member

@kraenhansen kraenhansen left a comment

Choose a reason for hiding this comment

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

Interesting change 👀
I'm not sure I 💯 % get it and why it would affect the return value of compact, but I believe you've tested this.

@kneth
Copy link
Contributor Author

kneth commented Oct 9, 2020

why it would affect the return value of compact

You cannot compact an open Realm. When the two instances are the same, closing one, closes the second one.

kneth added a commit that referenced this pull request Oct 9, 2020
kneth added a commit that referenced this pull request Oct 9, 2020
@blagoev blagoev merged commit a359513 into master Oct 12, 2020
@blagoev blagoev deleted the kneth/caching-realm-instances branch October 12, 2020 08:39
blagoev added a commit that referenced this pull request Oct 12, 2020
* Porting #3322

* Update CHANGELOG.md

Co-authored-by: blagoev <[email protected]>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 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.

3 participants