From 708d86702e8c5767e6d00a0996335dd274050847 Mon Sep 17 00:00:00 2001 From: Addy Pathania Date: Fri, 15 Mar 2024 10:43:27 -0400 Subject: [PATCH 1/2] fix retries type error --- .../templates/nextjs/src/lib/dictionary-service-factory.ts | 5 ++--- .../src/templates/nextjs/src/lib/layout-service-factory.ts | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/create-sitecore-jss/src/templates/nextjs/src/lib/dictionary-service-factory.ts b/packages/create-sitecore-jss/src/templates/nextjs/src/lib/dictionary-service-factory.ts index 5079b06129..9aa53dede7 100644 --- a/packages/create-sitecore-jss/src/templates/nextjs/src/lib/dictionary-service-factory.ts +++ b/packages/create-sitecore-jss/src/templates/nextjs/src/lib/dictionary-service-factory.ts @@ -37,9 +37,8 @@ export class DictionaryServiceFactory { By default it uses the `DefaultRetryStrategy` with exponential back-off factor of 2 and handles error codes 429, 502, 503, 504, 520, 521, 522, 523, 524, 'ECONNRESET', 'ETIMEDOUT' and 'EPROTO' . You can use this class or your own implementation of `RetryStrategy`. */ - retries: - process.env.GRAPH_QL_SERVICE_RETRIES && - parseInt(process.env.GRAPH_QL_SERVICE_RETRIES, 10), + retries: (process.env.GRAPH_QL_SERVICE_RETRIES && + parseInt(process.env.GRAPH_QL_SERVICE_RETRIES, 10)) as number, }) : new RestDictionaryService({ apiHost: config.sitecoreApiHost, diff --git a/packages/create-sitecore-jss/src/templates/nextjs/src/lib/layout-service-factory.ts b/packages/create-sitecore-jss/src/templates/nextjs/src/lib/layout-service-factory.ts index 464eb2b3ee..84e92f8dc0 100644 --- a/packages/create-sitecore-jss/src/templates/nextjs/src/lib/layout-service-factory.ts +++ b/packages/create-sitecore-jss/src/templates/nextjs/src/lib/layout-service-factory.ts @@ -30,9 +30,8 @@ export class LayoutServiceFactory { By default it uses the `DefaultRetryStrategy` with exponential back-off factor of 2 and handles error codes 429, 502, 503, 504, 520, 521, 522, 523, 524, 'ECONNRESET', 'ETIMEDOUT' and 'EPROTO' . You can use this class or your own implementation of `RetryStrategy`. */ - retries: - process.env.GRAPH_QL_SERVICE_RETRIES && - parseInt(process.env.GRAPH_QL_SERVICE_RETRIES, 10), + retries: (process.env.GRAPH_QL_SERVICE_RETRIES && + parseInt(process.env.GRAPH_QL_SERVICE_RETRIES, 10)) as number, }) : new RestLayoutService({ apiHost: config.sitecoreApiHost, From 1f4652f9f73baa8420b1585c0ae00ed4dc1ad456 Mon Sep 17 00:00:00 2001 From: Addy Pathania Date: Mon, 18 Mar 2024 16:33:49 -0400 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb2876bf0d..7e3f8af7d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,7 +32,7 @@ Our versioning strategy is as follows: * Handle additional string error codes like ECONNRESET, ETIMEDOUT, EPROTO. Can configure more using DefaultRetryStrategy. * Retries has now been enabled by default with a default value of 3. It can be disabled by configuring it to 0. * [Retry-After] header now falls back to the default delay time when it comes out to be empty. - ([#1755](https://github.com/Sitecore/jss/pull/1755)) + ([#1755](https://github.com/Sitecore/jss/pull/1755)) ([#1759](https://github.com/Sitecore/jss/pull/1759)) ### 🐛 Bug Fixes