This ticket documents an important optimization implemented in the GitHub issue synchronization service (SyncService.mjs).
Problem:
Previously, the pullFromGitHub method in SyncService.mjs used a static issueSyncConfig.syncStartDate value when querying GitHub for updated issues. This meant that even for incremental updates, the service would fetch all issues updated since a potentially very old syncStartDate, leading to unnecessary data transfer and processing, and resulting in slow synchronization times even when only a few issues had changed. The issue was particularly noticeable when all local issue folders were deleted, triggering a full re-sync that took approximately 20 seconds.
Solution:
The pullFromGitHub method has been modified to dynamically use metadata.lastSync as the since parameter for the FETCH_ISSUES_FOR_SYNC GraphQL query. This ensures that subsequent synchronizations only fetch issues that have been updated on GitHub since the last successful sync. If metadata.lastSync is not available (e.g., on the very first sync or after a metadata reset), it falls back to the configured issueSyncConfig.syncStartDate.
Impact:
- Improved Performance: Incremental synchronizations are now significantly faster as only truly updated issues are fetched and processed.
- Reduced API Usage: Less data is transferred from GitHub, conserving API rate limits.
- Correct Delta Logic: The synchronization now correctly implements delta updates based on the last successful sync timestamp.
Files Changed:
ai/mcp/server/github-workflow/services/SyncService.mjs
Verification:
- Observe faster sync times for incremental updates.
- Verify that deleting all local issue folders still triggers a full re-sync, which is expected behavior.
This ticket documents an important optimization implemented in the GitHub issue synchronization service (
SyncService.mjs).Problem: Previously, the
pullFromGitHubmethod inSyncService.mjsused a staticissueSyncConfig.syncStartDatevalue when querying GitHub for updated issues. This meant that even for incremental updates, the service would fetch all issues updated since a potentially very oldsyncStartDate, leading to unnecessary data transfer and processing, and resulting in slow synchronization times even when only a few issues had changed. The issue was particularly noticeable when all local issue folders were deleted, triggering a full re-sync that took approximately 20 seconds.Solution: The
pullFromGitHubmethod has been modified to dynamically usemetadata.lastSyncas thesinceparameter for theFETCH_ISSUES_FOR_SYNCGraphQL query. This ensures that subsequent synchronizations only fetch issues that have been updated on GitHub since the last successful sync. Ifmetadata.lastSyncis not available (e.g., on the very first sync or after a metadata reset), it falls back to the configuredissueSyncConfig.syncStartDate.Impact:
Files Changed:
ai/mcp/server/github-workflow/services/SyncService.mjsVerification: