Skip to content

Commit 97e9856

Browse files
committed
chore: fixing issues with rebase
1 parent 7994552 commit 97e9856

1 file changed

Lines changed: 16 additions & 9 deletions

File tree

packages/sdk/browser/src/compat/LDClientCompatImpl.ts

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,27 @@ export default class LDClientCompatImpl implements LDClient {
4545
this._client = makeClient(envKey, context, AutoEnvAttributes.Disabled, options);
4646
this._emitter = new LDEmitterCompat(this._client);
4747
this.logger = this._client.logger;
48-
this._initIdentify(bootstrap, hash);
48+
49+
// start the client, then immediately kick off an identify operation
50+
// in order to preserve the behavior of the previous SDK.
51+
this._client.start();
52+
this._initIdentify(context, bootstrap, hash);
4953
}
5054

51-
private async _initIdentify(bootstrap?: LDFlagSet, hash?: string): Promise<void> {
55+
private async _initIdentify(
56+
context: LDContext,
57+
bootstrap?: LDFlagSet,
58+
hash?: string,
59+
): Promise<void> {
5260
try {
53-
const result = await this._client.start({
54-
identifyOptions: {
55-
noTimeout: true,
56-
bootstrap,
57-
hash,
58-
},
61+
const result = await this._client.identify(context, {
62+
noTimeout: true,
63+
bootstrap,
64+
hash,
65+
sheddable: false,
5966
});
6067

61-
if (result.status === 'failed') {
68+
if (result.status === 'error') {
6269
throw result.error;
6370
} else if (result.status === 'timeout') {
6471
throw new LDTimeoutError('Identify timed out');

0 commit comments

Comments
 (0)