Skip to content

feat(http): add keepalive support for fetch requests in httpResource - #61833

Closed
SkyZeroZx wants to merge 1 commit into
angular:mainfrom
SkyZeroZx:add-keepalive-httpresource
Closed

SkyZeroZx wants to merge 1 commit into
angular:mainfrom
SkyZeroZx:add-keepalive-httpresource

Conversation

@SkyZeroZx

@SkyZeroZx SkyZeroZx commented Jun 2, 2025 •

Copy link
Copy Markdown
Contributor

This commit adds support for the Fetch API's keepalive option when using httpResource with the withFetch provider.

The keepalive option is particularly useful for:

Beacon API-like functionality (logging analytics on page unload)
Better control over connection management in long-lived applications

Example new usage :

httpResource(() => ({
  url: '/api/log',
  method: 'POST',
  keepalive: true,
}));

@pullapprove
pullapprove Bot requested a review from AndrewKushnir June 2, 2025 19:11
@angular-robot angular-robot Bot added detected: feature PR contains a feature commit area: common/http Issues related to HTTP and HTTP Client labels Jun 2, 2025
@ngbot ngbot Bot added this to the Backlog milestone Jun 2, 2025
@AndrewKushnir
AndrewKushnir requested review from alxhub and removed request for AndrewKushnir June 4, 2025 01:18

@iam-harig iam-harig left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM!

@SkyZeroZx

Copy link
Copy Markdown
Contributor Author

@alxhub Is any additional validation needed to be able to merge it?

@thePunderWoman thePunderWoman left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

reviewed-for: fw-general, public-api

@thePunderWoman thePunderWoman added action: merge The PR is ready for merge by the caretaker target: minor This PR is targeted for the next minor release labels Jun 24, 2025
@JeanMeche JeanMeche removed the action: merge The PR is ready for merge by the caretaker label Jun 24, 2025
This commit adds support for the Fetch API's keepalive option when using httpResource with the withFetch provider
@thePunderWoman
thePunderWoman force-pushed the add-keepalive-httpresource branch from 68629eb to 30290b1 Compare June 24, 2025 12:53

@kirjs kirjs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed-for: public-api

@thePunderWoman thePunderWoman added the action: merge The PR is ready for merge by the caretaker label Jun 24, 2025
@thePunderWoman

Copy link
Copy Markdown
Contributor

This PR was merged into the repository by commit 73269cf.

The changes were merged into the following branches: main

@SkyZeroZx
SkyZeroZx deleted the add-keepalive-httpresource branch June 26, 2025 01:55
@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Jul 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: common/http Issues related to HTTP and HTTP Client detected: feature PR contains a feature commit target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants