Inject fetch into REST transport#128
Open
Inv1x wants to merge 2 commits intoqdrant:masterfrom
Open
Conversation
- Remove undici dispatcher dependency - Delegate transport setup to host runtime - Add tests for custom fetch injection
There was a problem hiding this comment.
Pull request overview
This PR removes the REST client’s hard dependency on undici/dispatcher wiring by introducing a local fetch-based transport and allowing callers to inject a custom fetch implementation via QdrantClient construction.
Changes:
- Remove
undici+ dispatcher-based RequestInit wiring and dependency entries. - Add a new local fetcher abstraction and plumb
fetchinjection throughQdrantClient→ REST transport. - Update docs and unit tests to cover fetch injection and ensure
dispatcheris no longer set.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Removes top-level undici lock entries. |
| packages/js-client-rest/package.json | Drops undici dependency. |
| packages/js-client-rest/src/dispatcher.ts | Deletes Node-specific dispatcher implementation. |
| packages/js-client-rest/src/fetcher.ts | Adds new fetch wrapper used by REST transport (core behavioral change). |
| packages/js-client-rest/src/api-client.ts | Switches transport construction to the new fetcher + supports injected fetch. |
| packages/js-client-rest/src/types.ts | Adds fetch to internal REST args. |
| packages/js-client-rest/src/qdrant-client.ts | Exposes fetch injection on QdrantClientParams; deprecates maxConnections behavior. |
| packages/js-client-rest/tests/unit/api-client.test.ts | Adds assertions for no dispatcher and verifies injected fetch is used. |
| packages/js-client-rest/README.md | Updates support section and documents fetch injection. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Preserve full Retry-After header on 429 errors - Keep FormData request bodies intact - Parse large JSON integers as bigint when supported
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
undiciwith a local fetch wrapper.fetchimplementation when creatingQdrantClient.Testing
fetchis used instead ofglobal.fetch.dispatcher.