Skip to content

Preserve unchanged issue comments during incremental GitHub sync - #1061

Merged
WaylandYang merged 2 commits into
deeplethe:devfrom
Maya-Kid:codex/github-sync-comment-history
Oct 3, 2026
Merged

WaylandYang merged 2 commits into
deeplethe:devfrom
Maya-Kid:codex/github-sync-comment-history

Conversation

@Maya-Kid

@Maya-Kid Maya-Kid commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

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 since for 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:

  • Format check, workspace clippy with warnings denied, and workspace build passed
  • Guarded workspace tests: 1,410 passed, 0 failed; 6 existing opt-in tests ignored, with dedicated PostgreSQL 16/pgvector and PDF extraction required
  • Unchanged frontend at the same base: frozen pnpm 10.2.1 install, 228 tests, and production build passed

…es a document

Signed-off-by: dada-yan <BinjunYann@gmail.com>

@WaylandYang WaylandYang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@WaylandYang
WaylandYang merged commit 3410829 into deeplethe:dev Oct 3, 2026
6 checks passed
@WaylandYang WaylandYang mentioned this pull request Oct 3, 2026
@Maya-Kid
Maya-Kid deleted the codex/github-sync-comment-history branch October 15, 2026 03:29
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