Skip to content

Conversation

evan-onyx
Copy link
Contributor

Description

Fixes https://linear.app/danswer/issue/DAN-1950/github-cursor-pagination-infinite-loop-fix
Fix an issue where the cursor-based pagination for github resulted in an infinite loop due to returning a checkpoint too early

How Has This Been Tested?

tested manually, automated test of no infinite loop tbd

Backporting (check the box to trigger backport action)

Note: You have to check that the action passes, otherwise resolve the conflicts manually and tag the patches.

  • This PR should be backported (make sure to check that the backport attempt succeeds)
  • [Optional] Override Linear Check

@evan-onyx evan-onyx requested a review from a team as a code owner May 8, 2025 01:06
Copy link

vercel bot commented May 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
internal-search ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 9, 2025 4:42pm

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR addresses an infinite loop issue in GitHub's cursor-based pagination implementation by improving cursor URL state management and checkpoint handling.

  • Fixed premature checkpoint returns by properly tracking cursor URL state transitions in /backend/onyx/connectors/github/connector.py
  • Reduced CURSOR_LOG_FREQUENCY from 100 to 50 for better progress monitoring
  • Added proper type casting for paginated list slicing to prevent type-related errors
  • Improved error handling for missing repository cache in checkpoints
  • Added comprehensive test coverage in /backend/tests/unit/onyx/connectors/github/test_github_checkpointing.py to validate pagination behavior

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@Weves Weves added this pull request to the merge queue May 9, 2025
Merged via the queue into main with commit 4c0423f May 9, 2025
11 checks passed
@Weves Weves deleted the bugfix/github-cursor-infinite-loop branch May 9, 2025 22:30
ferdinandl007 pushed a commit to ferdinandl007/onyx that referenced this pull request May 19, 2025
* fix infinite loop

* unit test for infinite loop issue

* mypy version

* more logging

* unbound locals
ZhipengHe pushed a commit to ZhipengHe/onyx that referenced this pull request Jun 6, 2025
* fix infinite loop

* unit test for infinite loop issue

* mypy version

* more logging

* unbound locals
AnkitTukatek pushed a commit to TukaTek/onyx that referenced this pull request Sep 23, 2025
* fix infinite loop

* unit test for infinite loop issue

* mypy version

* more logging

* unbound locals
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