Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(http): resolve withRequestsMadeViaParent behavior with withFetch #55652

Closed
wants to merge 1 commit into from

Conversation

alan-agius4
Copy link
Contributor

@alan-agius4 alan-agius4 commented May 3, 2024

This commit addresses dependency injection defects when using the withFetch API. Formerly, utilizing withFetch led to the automatic setting of HttpBackend to FetchBackend, which proved problematic in certain scenarios. Notably, conflicts arose when integrating withRequestsMadeViaParent and manually overriding tokens, as observed in instances like InMemoryWebApiModule.

Reviewer note: I suggest that you enable hide whitespace.

@@ -294,26 +298,13 @@ export function withRequestsMadeViaParent(): HttpFeature<HttpFeatureKind.Request
/**
* Configures the current `HttpClient` instance to make requests using the fetch API.
*
* This `FetchBackend` requires the support of the Fetch API which is available on all evergreen
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are no longer needed as with v18 all versions of Node.js support fetch

@alan-agius4 alan-agius4 added area: common/http target: rc This PR is targeted for the next release-candidate labels May 3, 2024
@ngbot ngbot bot added this to the Backlog milestone May 3, 2024
This commit addresses dependency injection defects when using the `withFetch` API. Formerly, utilizing `withFetch` led to the automatic setting of `HttpBackend` to `FetchBackend`, which proved problematic in certain scenarios. Notably, conflicts arose when integrating `withRequestsMadeViaParent` and manually overriding tokens, as observed in instances like `InMemoryWebApiModule`.
@alan-agius4 alan-agius4 added the action: review The PR is still awaiting reviews from at least one requested reviewer label May 3, 2024
@alan-agius4 alan-agius4 marked this pull request as ready for review May 3, 2024 08:54
@pullapprove pullapprove bot requested a review from atscott May 3, 2024 08:54
@alan-agius4 alan-agius4 requested review from AndrewKushnir and removed request for atscott May 3, 2024 08:54
@AndrewKushnir AndrewKushnir removed the action: review The PR is still awaiting reviews from at least one requested reviewer label May 4, 2024
@alan-agius4 alan-agius4 added the action: merge The PR is ready for merge by the caretaker label May 4, 2024
@AndrewKushnir
Copy link
Contributor

This PR was merged into the repository by commit 9ddb003.

AndrewKushnir pushed a commit that referenced this pull request May 6, 2024
…ch` (#55652)

This commit addresses dependency injection defects when using the `withFetch` API. Formerly, utilizing `withFetch` led to the automatic setting of `HttpBackend` to `FetchBackend`, which proved problematic in certain scenarios. Notably, conflicts arose when integrating `withRequestsMadeViaParent` and manually overriding tokens, as observed in instances like `InMemoryWebApiModule`.

PR Close #55652
@alan-agius4 alan-agius4 deleted the http-fetch branch May 6, 2024 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker area: common/http target: rc This PR is targeted for the next release-candidate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants