commercetools / commercetools-sdk-typescript

The e-commerce SDK from commercetools for JavaScript written in TypeScript.
https://commercetools.github.io/commercetools-sdk-typescript/
MIT License
46 stars 25 forks source link

[Fix] Reset The Token Request State on Error #767

Closed ajimae closed 2 months ago

ajimae commented 2 months ago

Summary

Reset the token fetch signal state to default on error

Completed Task

changeset-bot[bot] commented 2 months ago

🦋 Changeset detected

Latest commit: 88527d0120289e0994caccfa7cb0d6368324be9e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ------------------------ | ----- | | @commercetools/ts-client | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

ajimae commented 2 months ago

There is also this part where you should set it to false as well:

https://github.com/commercetools/commercetools-sdk-typescript/blob/915d39b9a75acfbc00c26ff7a3c62fa3bacae5d8/packages/sdk-client-v3/src/middleware/auth-middleware/auth-request-executor.ts#L79C22-L80C1

Done 8e1e1b2

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 92.85%. Comparing base (2d53841) to head (88527d0).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #767 +/- ## ======================================= Coverage 92.85% 92.85% ======================================= Files 25 25 Lines 280 280 Branches 12 12 ======================================= Hits 260 260 Misses 20 20 ``` | [Flag](https://app.codecov.io/gh/commercetools/commercetools-sdk-typescript/pull/767/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=commercetools) | Coverage Δ | | |---|---|---| | [integrationtests](https://app.codecov.io/gh/commercetools/commercetools-sdk-typescript/pull/767/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=commercetools) | `92.85% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=commercetools#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

lojzatran commented 2 months ago

There is also this part where you should set it to false as well: https://github.com/commercetools/commercetools-sdk-typescript/blob/915d39b9a75acfbc00c26ff7a3c62fa3bacae5d8/packages/sdk-client-v3/src/middleware/auth-middleware/auth-request-executor.ts#L79C22-L80C1

Done 8e1e1b2

Maybe put it inside the if?