From d995286e8d9853f6f35403a5208397dcd39bc904 Mon Sep 17 00:00:00 2001 From: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com> Date: Thu, 25 Apr 2024 10:57:13 -0700 Subject: [PATCH 1/2] fix: Adjust identify timeout message. --- packages/shared/sdk-client/src/LDClientImpl.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/shared/sdk-client/src/LDClientImpl.ts b/packages/shared/sdk-client/src/LDClientImpl.ts index 8cdf53dc38..eef1cb12f5 100644 --- a/packages/shared/sdk-client/src/LDClientImpl.ts +++ b/packages/shared/sdk-client/src/LDClientImpl.ts @@ -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); From 523e5e8fb67f95c97248c1da1ae1f2ee4c7ec4cd Mon Sep 17 00:00:00 2001 From: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com> Date: Thu, 25 Apr 2024 11:03:18 -0700 Subject: [PATCH 2/2] Fix test. --- packages/shared/sdk-client/src/LDClientImpl.timeout.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/shared/sdk-client/src/LDClientImpl.timeout.test.ts b/packages/shared/sdk-client/src/LDClientImpl.timeout.test.ts index fe3e2c3c5c..85e8e3d59b 100644 --- a/packages/shared/sdk-client/src/LDClientImpl.timeout.test.ts +++ b/packages/shared/sdk-client/src/LDClientImpl.timeout.test.ts @@ -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 () => { @@ -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 () => { @@ -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/)); }); });