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

feat: Add callback context and redirect history 2 #769

Merged
merged 16 commits into from
Apr 24, 2021
Merged

feat: Add callback context and redirect history 2 #769

merged 16 commits into from
Apr 24, 2021

Conversation

ronag
Copy link
Member

@ronag ronag commented Apr 24, 2021

No description provided.

@ronag
Copy link
Member Author

ronag commented Apr 24, 2021

@ShogunPanda PTAL

@ronag ronag force-pushed the 698 branch 2 times, most recently from 165d7c3 to 615e8c6 Compare April 24, 2021 17:30
this.abort = abort
this.handler.onConnect(abort)
this.handler.onConnect(abort, { ...context, history: this.history })
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm thinking maybe we should put history as a symbol we make public as to avoid collisions in the future?

Copy link
Contributor

Choose a reason for hiding this comment

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

We could, but I think the external API might look a little complicated.

@ShogunPanda
Copy link
Contributor

LGTM!

@ronag ronag marked this pull request as ready for review April 24, 2021 19:10
@ronag ronag changed the title 698 feat: Add callback context and redirect history 2 Apr 24, 2021
@codecov-commenter
Copy link

codecov-commenter commented Apr 24, 2021

Codecov Report

Merging #769 (db9dbf0) into main (6ecf6f2) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #769   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           24        24           
  Lines         1906      1918   +12     
=========================================
+ Hits          1906      1918   +12     
Impacted Files Coverage Δ
lib/agent.js 100.00% <100.00%> (ø)
lib/api/api-connect.js 100.00% <100.00%> (ø)
lib/api/api-pipeline.js 100.00% <100.00%> (ø)
lib/api/api-request.js 100.00% <100.00%> (ø)
lib/api/api-stream.js 100.00% <100.00%> (ø)
lib/api/api-upgrade.js 100.00% <100.00%> (ø)
lib/core/request.js 100.00% <100.00%> (ø)
lib/handler/redirect.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6ecf6f2...db9dbf0. Read the comment docs.

docs/api/Dispatcher.md Outdated Show resolved Hide resolved
docs/api/Agent.md Outdated Show resolved Hide resolved
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@ronag ronag merged commit 193b5d2 into main Apr 24, 2021
@Uzlopak Uzlopak deleted the 698 branch February 21, 2024 12:38
crysmags pushed a commit to crysmags/undici that referenced this pull request Feb 27, 2024
* feat: Add callback context and redirect history.

* feat: Updated TypeScript types.

* fix: Make sure context exist before modifying it.

* fixup

* fixup

* fixup

* perf: reuse redirect handler

* fixup

* fixup

* fixuP

* fixup

* fixup

* Apply suggestions from code review

* fixup

Co-authored-by: Paolo Insogna <paolo@cowtech.it>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants