-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Fix repo API listing stability #12057
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
As noted in the Issue I'm not sure this is a complete fix as other API pagination methods may have similar problems. I'm also in the process of getting this tested properly locally, but I wanted to get this up so that others could offer suggestions or additional fixes if necessary. |
I'm doing more testing locally and I'm not sure this fixes the issue for us yet. In any case it should serve as a starting point for figuring it out. |
Repo listings are paginated in the API now. Unfortunately, they are ORDER BY updated_unix which only has second resolution. This means that if you do a listing when multiple projects were created at the same time you can unstable ordering. If that unstable ordering happens at a page boundary you may fail to get a complete repo listing. To make things worse sorting by updated_unix means that we may never get a complete listing because udpated_unix can change independent of our API calls. Fix this by making the API repo listing order by id instead.
57bbb30
to
a67f21c
Compare
New version does and ascending not descending sort. I realized that if a new repo is added during a listing we'll get that inserted at the front not the end using descending. If we use ascending it will be added at the end and a user paging through the list will see the new repo. In the end both should work, but ascending is a bit more friendly I think. |
make lg-tm work |
Repo listings are paginated in the API now. Unfortunately, they are ORDER BY updated_unix which only has second resolution. This means that if you do a listing when multiple projects were created at the same time you can unstable ordering. If that unstable ordering happens at a page boundary you may fail to get a complete repo listing. To make things worse sorting by updated_unix means that we may never get a complete listing because udpated_unix can change independent of our API calls. Fix this by making the API repo listing order by id instead.
This addresses #12056
Repo listings are paginated in the API now. Unfortunately, they are
ORDER BY updated_unix which only has second resolution. This means that
if you do a listing when multiple projects were created at the same time
you can unstable ordering. If that unstable ordering happens at a page
boundary you may fail to get a complete repo listing.
To make things worse sorting by updated_unix means that we may never get
a complete listing because udpated_unix can change independent of our
API calls.
Fix this by making the API repo listing order by id instead.