Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/shared/sdk-client/src/LDClientImpl.timeout.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ describe('sdk-client identify timeout', () => {
await ldc.identify(carContext, { timeout: customTimeout });

expect(ldc.identifyTimeout).toEqual(10);
expect(logger.warn).not.toHaveBeenCalledWith(expect.stringMatching(/high timeout/));
expect(logger.warn).not.toHaveBeenCalledWith(expect.stringMatching(/timeout greater/));
});

test('warning when timeout is too high', async () => {
Expand All @@ -131,7 +131,7 @@ describe('sdk-client identify timeout', () => {

await ldc.identify(carContext, { timeout: highTimeout });

expect(logger.warn).toHaveBeenCalledWith(expect.stringMatching(/high timeout/));
expect(logger.warn).toHaveBeenCalledWith(expect.stringMatching(/timeout greater/));
});

test('safe timeout should not warn', async () => {
Expand All @@ -142,6 +142,6 @@ describe('sdk-client identify timeout', () => {

await ldc.identify(carContext, { timeout: safeTimeout });

expect(logger.warn).not.toHaveBeenCalledWith(expect.stringMatching(/high timeout/));
expect(logger.warn).not.toHaveBeenCalledWith(expect.stringMatching(/timeout greater/));
});
});
6 changes: 5 additions & 1 deletion packages/shared/sdk-client/src/LDClientImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,11 @@ export default class LDClientImpl implements LDClient {
}

if (this.identifyTimeout > this.highTimeoutThreshold) {
this.logger.warn('identify called with high timeout parameter.');
this.logger.warn(
'The identify function was called with a timeout greater than' +
`${this.highTimeoutThreshold} seconds. We recommend a timeout of less than` +
`${this.highTimeoutThreshold} seconds.`,
);
}

let context = await ensureKey(pristineContext, this.platform);
Expand Down