Skip to content
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

from_global_id() differs from reference implementation #39

Closed
markedwards opened this issue Jan 16, 2022 · 6 comments
Closed

from_global_id() differs from reference implementation #39

markedwards opened this issue Jan 16, 2022 · 6 comments
Assignees

Comments

@markedwards
Copy link
Contributor

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") raises binascii.Error
  • from_global_id("") raises TypeError
  • from_global_id(b64encode(b"foo")) raises TypeError

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.

@Cito
Copy link
Member

Cito commented Jan 19, 2022

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.

@markedwards
Copy link
Contributor Author

Yeah, I agree that porting the relay-js implementation is the right plan. If I get time I will try to contribute here.

@Cito
Copy link
Member

Cito commented Jan 19, 2022

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.

@Cito
Copy link
Member

Cito commented Jan 20, 2022

Ok, @syrusakbary already responded, will work on it this week.

@markedwards
Copy link
Contributor Author

Great. Since you are able to contact him, can you ask him to unbreak aiodataloader? People are getting exasperated:
syrusakbary/aiodataloader#16

@Cito
Copy link
Member

Cito commented Jan 22, 2022

This should be solved in v3.1.3 now. Please reopen if there are still any differences.

@Cito Cito closed this as completed Jan 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants