-
Notifications
You must be signed in to change notification settings - Fork 175
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 null value parsing #1668
Fix null value parsing #1668
Conversation
Hey thanks for reporting and fixing the issue! Could you also add a test for the issue? Lemme know if you need help running the tests. The contribution docs are immature still. |
@KyleAMathews Thanks for your quick reply. I just wrote a test, made the check more precise and added a comment to explain why the check for null is required. If you run the test without my change, it will fail with the error posted above. |
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.
Hi @dustin-H,
Thanks for contributing this PR.
After taking a closer look, i think the test is wrong (see my comment there) because the message is ill-formed. As a result, the fix is fixing something that cannot occur.
You're referring to a bug:
While integrating it I found a bug:
When a shape includes a column, that is nullable and currently null or set to null, the typescript client is crashing
Could you open an issue with a reproduction for this please?
We have unit tests that check that null values are parsed correctly, but perhaps we are missing a corner case. Feel free to contribute that test case if you want.
Fixes #1673. |
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.
Thank you for contributing the test case we were missing for columns named "value" and providing the fix 💯
Hi there, first of all, I really like your project! Amazing work! 🚀 Thank you! While integrating it I found a bug: When a shape includes a column, that is nullable and currently null or set to null, the typescript client is crashing: <img width="637" alt="Screenshot 2024-09-11 at 07 20 16" src="https://github.com/user-attachments/assets/0667fcc4-aa32-4a2f-9d29-3866fc1e53bc"> The code is checking if the `typeof value` is `object` and is then trying to iterate over it's keys. However, `typeof null` is also `object`. This is why it crashes here, as it cannot iterate over null. This PR fixes #1673. A simple check for `null` fixes this as proposed in this PR. Could you please merge it? Or is there anything I've overseen? Thanks! --------- Co-authored-by: Kevin De Porre <[email protected]>
Hi there,
first of all, I really like your project! Amazing work! 🚀
Thank you!
While integrating it I found a bug:
When a shape includes a column, that is nullable and currently null or set to null, the typescript client is crashing:
The code is checking if the
typeof value
isobject
and is then trying to iterate over it's keys.However,
typeof null
is alsoobject
. This is why it crashes here, as it cannot iterate over null.This PR fixes #1673.
A simple check for
null
fixes this as proposed in this PR.Could you please merge it? Or is there anything I've overseen?
Thanks!