diff --git a/CHANGELOG.md b/CHANGELOG.md index 8df2eff94e..04eb954ddf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,7 +37,7 @@ Our versioning strategy is as follows: * `[templates/nextjs-sxa]` Fix feature `show Grid column` in Experience Editor. ([#1704](https://github.com/Sitecore/jss/pull/1704)) * `[sitecore-jss-nextjs] [templates/nextjs-xmcloud]` SDK initialization rejections are now correctly handled. Errors should no longer occur after getSDK() promises resolve when they shouldn't (for example, getting Events SDK in development environment) ([#1712](https://github.com/Sitecore/jss/pull/1712) [#1715](https://github.com/Sitecore/jss/pull/1715) [#1716](https://github.com/Sitecore/jss/pull/1716)) * `[sitecore-jss-nextjs]` Fix redirects middleware for working with absolute url where is using site language context ([#1727](https://github.com/Sitecore/jss/pull/1727)) ([#1737](https://github.com/Sitecore/jss/pull/1737)) -* `[sitecore-jss]` Retry policy to handle transient network errors. Users can pass `retryStrategy` to configure custom retry config to the services. They can customize the error codes and the number of retries. It consist of two functions shouldRetry and getDelay. To determine the back-off time, we employ an exponential strategy with a default factor of 2.([#1731](https://github.com/Sitecore/jss/pull/1731)) ([#1733](https://github.com/Sitecore/jss/pull/1733)) ([#1738](https://github.com/Sitecore/jss/pull/1738)) +* `[sitecore-jss]` Enable the Layout and dictionary service to use custom `retryStrategy`. ([#1749](https://github.com/Sitecore/jss/pull/1749)) ### 🛠 Breaking Changes diff --git a/packages/sitecore-jss/src/i18n/graphql-dictionary-service.ts b/packages/sitecore-jss/src/i18n/graphql-dictionary-service.ts index dd924d82df..7a2b0fc363 100644 --- a/packages/sitecore-jss/src/i18n/graphql-dictionary-service.ts +++ b/packages/sitecore-jss/src/i18n/graphql-dictionary-service.ts @@ -178,6 +178,7 @@ export class GraphQLDictionaryService extends DictionaryServiceBase { return this.options.clientFactory({ debugger: debug.dictionary, retries: this.options.retries, + retryStrategy: this.options.retryStrategy, }); } @@ -185,6 +186,7 @@ export class GraphQLDictionaryService extends DictionaryServiceBase { apiKey: this.options.apiKey, debugger: debug.dictionary, retries: this.options.retries, + retryStrategy: this.options.retryStrategy, }); } } diff --git a/packages/sitecore-jss/src/layout/graphql-layout-service.ts b/packages/sitecore-jss/src/layout/graphql-layout-service.ts index 2fade8bfae..131bb37870 100644 --- a/packages/sitecore-jss/src/layout/graphql-layout-service.ts +++ b/packages/sitecore-jss/src/layout/graphql-layout-service.ts @@ -102,6 +102,7 @@ export class GraphQLLayoutService extends LayoutServiceBase { return this.serviceConfig.clientFactory({ debugger: debug.layout, retries: this.serviceConfig.retries, + retryStrategy: this.serviceConfig.retryStrategy, }); } @@ -109,6 +110,7 @@ export class GraphQLLayoutService extends LayoutServiceBase { apiKey: this.serviceConfig.apiKey, debugger: debug.layout, retries: this.serviceConfig.retries, + retryStrategy: this.serviceConfig.retryStrategy, }); } diff --git a/packages/sitecore-jss/src/site/graphql-error-pages-service.ts b/packages/sitecore-jss/src/site/graphql-error-pages-service.ts index 32f704dd45..cb047b2238 100644 --- a/packages/sitecore-jss/src/site/graphql-error-pages-service.ts +++ b/packages/sitecore-jss/src/site/graphql-error-pages-service.ts @@ -25,7 +25,7 @@ const defaultQuery = /* GraphQL */ ` `; export interface GraphQLErrorPagesServiceConfig - extends Pick { + extends Pick { /** * Your Graphql endpoint * @deprecated use @param clientFactory property instead @@ -124,6 +124,7 @@ export class GraphQLErrorPagesService { return this.options.clientFactory({ debugger: debug.errorpages, retries: this.options.retries, + retryStrategy: this.options.retryStrategy, }); } @@ -131,6 +132,7 @@ export class GraphQLErrorPagesService { apiKey: this.options.apiKey, debugger: debug.errorpages, retries: this.options.retries, + retryStrategy: this.options.retryStrategy, }); } }