Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
fix: maintain a ref count for objects sent over remote #17464
See #17464 (comment) for explanation
This also includes the test change as that is the "repro" for this issue
Previously when this assertion failed all tests that ran after the failed assertion also failed. This ensure that the assertion fails for the test that actually caused the issue but cleans up the left-over windows so that future tests do not fail.
Notes: Fixed race condition where the
Apr 15, 2019
This would trigger another regression. Consider following situation:
I think this PR fixes the CI failure because it deferred the
Apr 16, 2019
This is the exact race condition we were hitting. In a rare case when a remote object was fetched a second time and a GC occured at the right time (between the main process sending the remote object metadata and the renderer process pulling the proxy out of a weak map) the renderer would tell the main process that the object had been GC'ed but would then on the next tick receive a remote message telling it to use the object it just free'ed.
I've included the commit message below for more info:
Note to self: test failures are because I didn't update https://github.com/electron/electron/blob/master/lib/browser/objects-registry.js#L69
Secondary note to self: typescript would have caught this