Skip to content

fix: drain HTTP body, paginate Qdrant scroll, deduplicate extractUniqueDirs#2

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/code-review-project-analysis
Draft

fix: drain HTTP body, paginate Qdrant scroll, deduplicate extractUniqueDirs#2
Copilot wants to merge 2 commits intomasterfrom
copilot/code-review-project-analysis

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 17, 2026

Code review of the VedCode project surfaced three issues.

HTTP connection leak in EnsureCollection

Response body not drained before close, preventing keep-alive connection reuse.

// before
resp.Body.Close()

// after
io.Copy(io.Discard, resp.Body)
resp.Body.Close()

Hardcoded scroll limit of 1000

GetAllFilePoints / GetAllDirPoints used a single scroll request with limit: 1000. Projects exceeding that silently drop records — stale files aren't cleaned up and unchanged files get re-indexed.

Extracted scrollAll() with cursor-based pagination via Qdrant's next_page_offset. Added TestGetAllFilePoints_Pagination covering multi-page retrieval.

Redundant extractUniqueDirs call

indexer.Run() computed extractUniqueDirs(walkResult.Files) twice with the same input. Reused the existing currentDirs variable.


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

…xtractUniqueDirs

Co-authored-by: danilin-em <46928452+danilin-em@users.noreply.github.com>
Copilot AI changed the title [WIP] Conduct code review for project analysis fix: drain HTTP body, paginate Qdrant scroll, deduplicate extractUniqueDirs Mar 17, 2026
Copilot AI requested a review from danilin-em March 17, 2026 04:43
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.

2 participants