-
Notifications
You must be signed in to change notification settings - Fork 2k
fix github cursor pagination infinite loop #4673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this 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
* fix infinite loop * unit test for infinite loop issue * mypy version * more logging * unbound locals
* fix infinite loop * unit test for infinite loop issue * mypy version * more logging * unbound locals
* fix infinite loop * unit test for infinite loop issue * mypy version * more logging * unbound locals
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.