-
Notifications
You must be signed in to change notification settings - Fork 28
Description
Describe the bug
Potentially an extension of #13. The Store instance is created with an initial hash
argument but does not update the hash when ldClient.identify()
is called. When launchdarkly-electron-client-sdk
is being used, the electron-json-storage
library frequently cannot handle the length of the hash generated from the LDUser
provided by ident.getUser()
.
To reproduce
- Initialize
launchdarkly-electron-client-sdk
in the Electron main process, e.g. with user{ key: '123', name: 'user', email: '[email protected]' }
. - Initialize the client in a renderer process.
- Update the identity of the user using
identify()
. Use anLDUser
with a lot of custom props. - When the client clears flags, an
ENAMETOOLONG
exception will be thrown ifgetFlagsKey
creates a key that is too long from the JSON stringification of the user.
Expected behavior
- It is possible to supply a hash in the options provided to
LDElectron.initializeInMain
(this would be in https://github.com/launchdarkly/electron-client-sdk). - When
identify()
is called, thehash
argument provided updates the hash in theStore
closure in case it wasn't provided when theStore
was created (to avoid theENAMETOOLONG
error on subsequent calls toidentify()
).
Logs
Log from our app in which abTestingService
acts as logger
for the SDK and adds some extra logs.
log.log
SDK version
launchdarkly-electron-client-sdk 1.6.1
launchdarkly-eventsource 1.4.0
launchdarkly-js-client-sdk 2.19.1
launchdarkly-js-sdk-common 3.3.1
Language version, developer tools
Node.js v12.18.3
NPM 7.6.0
TypeScript 3.9.9
Webpack 4.46.0
OS/platform
macOS Big Sur 11.3.1
Electron 11.4.4
Additional context
Let me know if I can provide any more context!