-
Notifications
You must be signed in to change notification settings - Fork 253
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
fix(electron): Do not sync to NativeClient when autoDetectErrors
or nativeCrashes
are disabled
#2040
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might be safer to check for enabledErrorTypes.nativeCrashes
before trying to sync to the native client rather than removing this error
7a51cff
to
d37abc8
Compare
autoDetectErrors
or nativeCrashes
are disabled
b05739e
to
2dbb794
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couple of small comments, but approved based on unit tests as I don't understand enough about Session.prototype._track
or client._sessionDelegate
and why you would use one over the other.
packages/plugin-electron-client-state-persistence/test/client-state-persistence.test.ts
Outdated
Show resolved
Hide resolved
2dbb794
to
81080c9
Compare
|
Goal
If either of
enabledErrorTypes.nativeCrashes
orautoDetectErrors
are disabled, we don't install the sync layer (NativeClient.install
) but still call all the methods to sync state to the native client.Currently this logs an error message:
Sync layer is not installed, first call install()
, which isn't very useful as users can't callNativeClient.install
This PR updates each of the plugins that sync to the native layer to ensure that they do not sync to the native layer if those config options are disabled. This affects:
plugin-electron-client-state-persistence
plugin-electron-app
plugin-electron-device
plugin-electron-session
Testing
Added unit tests to assert that the native sync methods are not called when the relevant config options are disabled.
Also updated the
makeClientForPlugin
function inelectron-test-helpers
to support creating a client with an array of plugins - this allows theclient-state-persistence
unit tests to make use of the test helper since the plugin depends on theclient-state-manager
plugin being loaded.