-
Notifications
You must be signed in to change notification settings - Fork 29
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
fix: CusrorPaginator null encoding bug #1161
Conversation
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## main #1161 +/- ##
==========================================
- Coverage 96.07% 96.06% -0.01%
==========================================
Files 838 836 -2
Lines 19779 20012 +233
==========================================
+ Hits 19002 19225 +223
- Misses 777 787 +10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
📢 Thoughts on this report? Let us know! |
✅ All tests successful. No failed tests were found. 📣 Thoughts on this report? Let Codecov know! | Powered by Codecov |
graphql_api/helpers/connection.py
Outdated
try: | ||
orderings = b64decode(cursor.encode("ascii")).decode("utf8") | ||
orderings = orderings.split(self.delimiter) | ||
return [None if ordering == "\x1f" else ordering for ordering in orderings] |
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.
Damn, weird bug/good find
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.
Nit, make a var for \x1f since we use in multiple places and to explain what the val is/why it's needed
7545d88
to
e7d56ac
Compare
the CursorPaginator encodes `None` values as the string "None", and on decoding it interprets that as just another string which is causing bugs when running the SQL, because we'll be comparing random types against a string instead of against null this fixes that by assigning a specific value (\x1f) that is unlikely to be in any user provided string that we would want to filter by
e7d56ac
to
ab1977e
Compare
the CursorPaginator encodes
None
values as the string "None", and on decoding it interprets that as just another string which is causing bugs when running the SQL, because we'll be comparing random types against a string instead of against nullthis fixes that by assigning a specific value (\x1f) that is unlikely to be in any user provided string that we would want to filter by