Repository navigation
Preserve unchanged issue comments during incremental GitHub sync - #1061
Merged
WaylandYang merged 2 commits intoOct 3, 2026
Merged
Conversation
…es a document Signed-off-by: dada-yan <BinjunYann@gmail.com>
WaylandYang
approved these changes
Oct 3, 2026
WaylandYang
left a comment
Contributor
There was a problem hiding this comment.
Thanks @Maya-Kid. The loss is real: the document is replaced whole on every sync, so asking the comments endpoint for only what changed since the last run dropped every unchanged comment on a title edit. Fetching each selected issue's full comment history, after the PR filter and the per-sync limit, is the right shape, and it costs one more request per issue written, which the issue list's since keeps small. The test through a mock API, real versions and blob storage covers the cases that matter, including a failed second page leaving the earlier document in place. Landing it.
Merged
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.
Updating an issue title after an initial sync could remove every unchanged comment from its current document. The issue and repository-comment endpoints both used
since, but ingestion replaces the entire document instead of applying a comment delta.Keep incremental selection on the issue list and fetch comments without
sincefor each selected issue, after PR filtering and the issue limit. Fetch, sort, and render one discussion at a time to bound memory. The existing per-endpoint limit of 10 pages remains; this change adds a comments request per selected issue rather than a repository-wide request.The regression exercises mock GitHub HTTP through real PostgreSQL, document versions, and blob storage. It failed before the fix on a title-only update and now covers unchanged/edited/new comments, pagination, failed second pages preserving the prior document, idempotent retry, and deleted comments.
Validation: