-
Notifications
You must be signed in to change notification settings - Fork 40
from_global_id() differs from reference implementation #39
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
Comments
Thanks for reporting. We are still lagging behind relay-js which switched to a custom base64 implementation in version 0.8 to make the behavior more predictable on different platforms. I'm currently trying to bring relay-py in line with the current version of relay-js and will then probably use the same implementation so that we will be fully compatible again. |
Yeah, I agree that porting the relay-js implementation is the right plan. If I get time I will try to contribute here. |
The main problem is that we currently cannot release because travis-ci.org stopped working. We need the project owner on PyPI @syrusakbary so we can repair this, I already contacted him. |
Ok, @syrusakbary already responded, will work on it this week. |
Great. Since you are able to contact him, can you ask him to unbreak aiodataloader? People are getting exasperated: |
This should be solved in v3.1.3 now. Please reopen if there are still any differences. |
The python
from_global_id
does not exhibit the same behavior as the reference TypeScript implementation when handling invalid input.Examples:
from_global_id("invalid")
raisesbinascii.Error
from_global_id("")
raisesTypeError
from_global_id(b64encode(b"foo"))
raisesTypeError
In the first two cases, the reference implementation returns
{type: "", id: ""}
. In the third case, it returns{type: "", id: "foo"}
. In no case does it throw an error.This might seem like nitpicking, but it can cause significant differences in how user input ends up being handled.
The text was updated successfully, but these errors were encountered: