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

Handle float/int slice problem and null values #19

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

compscidr
Copy link

@compscidr compscidr commented Sep 11, 2023

Based on findings outlined here: #14 (comment)

I think this will handle the case where we values which are mostly ints, but we get a float, or we have mostly floats but get an int (this is possible because firebase will change floats which are even to ints, for instance if you try to save 400.0, firebase will save it as 400, and if all the other values in a collection are floats, we will have problems trying to append to the slice with the existing code.

I expect adding a null into the mix will cause a similar crash, so in this case, I just detected a nil and added a 0 or 0.0 depending on the slice type.

I'm not entirely sure there isn't also a problem in the fireql library that this uses as well - will try out to verify asap.

@pgollangi
Copy link
Owner

LGTM! Thanks a lot @compscidr for the contribution.

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

Successfully merging this pull request may close these issues.

None yet

2 participants