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

message_id is not always an int #4

Closed
yannleretaille opened this issue Nov 2, 2016 · 3 comments
Closed

message_id is not always an int #4

yannleretaille opened this issue Nov 2, 2016 · 3 comments

Comments

@yannleretaille
Copy link
Contributor

Thanks for merging and fixing the tests!
The issue with message_id still persists however. Maybe a way to handle it would be to mark it as None when "fake_message_id" is returned and Some(u64) when its an actual number. The downside would be that we loose the information that this is a dry_run, but maybe that could be added to the Response struct.
The fix could be implemented by interpreting message_id as a string and then do:
let message_id_int: u64 = message_id.parse().ok();

@vishy1618
Copy link
Owner

vishy1618 commented Nov 2, 2016 via email

@yannleretaille
Copy link
Contributor Author

I do not want it to be string. GCM returns a string ("fake_message_id") when doing a dry_run. The crate is not handling that case right now and panics trying to convert the string into a u64. Thats why on my local version, I changed the type of message_id to string, but the best way to fix it is imho to parse it as proposed.

@vishy1618
Copy link
Owner

Addressed this with 0.2.0 using serde::json custom deserialising for that field.

pimeys referenced this issue in panicbit/fcm-rust Jun 15, 2017
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