Enable and fix "clean exit" tests #6354
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Compatibility
label is updated or copied from previous entryCOMPATIBILITY.md
package.json
s (if updating internal packages)Breaking
label has been applied or is not necessary