Backport GetPreExistingChunksIdsAsync pagination fix - #7313
Merged
adamsitnik merged 3 commits intoFeb 17, 2026
Merged
Conversation
Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Backport GetPreExistingChunksIdsAsync fix to data-ingestion-preview2 branch
Backport GetPreExistingChunksIdsAsync pagination fix
Feb 16, 2026
adamsitnik
reviewed
Feb 16, 2026
adamsitnik
left a comment
Member
There was a problem hiding this comment.
@copilot please address my feedback
Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
Contributor
Author
adamsitnik
approved these changes
Feb 16, 2026
adamsitnik
marked this pull request as ready for review
February 16, 2026 17:06
adamsitnik
deleted the
copilot/backport-getpreexistingchunksidsasync-fix
branch
February 17, 2026 11:32
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Backport GetPreExistingChunksIdsAsync fix to data-ingestion-preview2 branch ✅
Changes Completed:
Skipparameter toGetAsynccall inGetPreExistingChunksIdsAsyncmethod to fix infinite loop bugIncrementalIngestion_WithManyRecords_DeletesAllPreExistingChunksto verify pagination works correctlyTestChunkFactory.CreateChunkfor proper token counting instead of hardcoded valuesSummary:
Successfully backported the fix from PR #7311 to the data-ingestion-preview2 branch. The fix resolves an infinite loop bug where
GetPreExistingChunksIdsAsyncwould repeatedly fetch the same records when a document had more than 1,000 pre-existing chunks.Technical Details:
Bug Fix: Added
options: new() { Skip = keys.Count }to theGetAsynccall to properly paginate through results.Test Implementation: Uses
TestChunkFactory.CreateChunkto create chunks with properly calculated token counts using the tokenizer, rather than hardcoded values.Test Results:
✅ All 14 VectorStoreWriter tests passed on net8.0, net9.0, and net10.0
✅ New test
IncrementalIngestion_WithManyRecords_DeletesAllPreExistingChunksverifies pagination with 2500 chunks✅ Code review found no issues
✅ Security scan found no vulnerabilities
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
Microsoft Reviewers: Open in CodeFlow