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
IndexError for CursorPagination when queryset changes #6504
Comments
I'm going to try and have a go at it. If there's no news from me by April 15, consider I'm not on it anymore. |
For the record I can't repoduce when following the exact steps of the ticket, but if I try to go back to page 1 then I have the same traceback. |
Adding some info: the cursor pagination may have 3 parameters: position, offset and cursor. The bug is triggered when:
This is because the The following comment:
... encompasses the error. This assumption is wrong if the page is empty. Fixing the logic and telling the algorithm to check if the page is empty and then set the position to PR will follow. |
Co-Authored-By: Tom Quinonero <tq@3yourmind.com>
Co-Authored-By: Tom Quinonero <tq@3yourmind.com>
Thanks @ewjoachim and @tomchristie 👍 |
…6504) (encode#6593) * Added regression tests (encode#6504) Co-Authored-By: Tom Quinonero <tq@3yourmind.com> * Fix CursorPagination when objects get deleted between calls (encode#6504) Co-Authored-By: Tom Quinonero <tq@3yourmind.com>
…6504) (encode#6593) * Added regression tests (encode#6504) Co-Authored-By: Tom Quinonero <tq@3yourmind.com> * Fix CursorPagination when objects get deleted between calls (encode#6504) Co-Authored-By: Tom Quinonero <tq@3yourmind.com>
Checklist
master
branch of Django REST framework.Steps to reproduce
Expected behavior
To be honest I'm not sure, maybe an empty page.
Actual behavior
The text was updated successfully, but these errors were encountered: