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

Enable and fix "clean exit" tests #6354

Closed
wants to merge 3 commits into from
Closed

Enable and fix "clean exit" tests #6354

wants to merge 3 commits into from

Conversation

kraenhansen
Copy link
Member

What, How & Why?

This closes #4535 if the Realm.clearTestState is called.
It relies on realm/realm-core#7231 being merged and released.

To be honest, this doesn't feel like the "right" fix, since we have this problem not only with App instances, but any object backed by an "internal" returned from core.
These "internal" objects hold shared pointer references of C++ objects which protects JS values that it gets passed (such as functions passed through configs, etc).
The "internal" shared pointers only get reset when the wrapping JS object gets garbage collected, which in turn allows for the captured JS values to be garbage collected.
All of this introduce delays (JS values being garbage collected → freeing C++ objects → unprotecting JS values → JS values being garbage collected).

The "right" solution would be to find a better way to handle references to objects between JS and C++ that allows earlier garbage collection.

☑️ 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

@kraenhansen
Copy link
Member Author

Part of this PR was cherry-picked into #6571.

@kraenhansen
Copy link
Member Author

Closing this since we believe the Realm.shutdown method introduced in #6571 would suffice for now.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 10, 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.

Process does not exit when using new Realm.App on Node
1 participant