-
Notifications
You must be signed in to change notification settings - Fork 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
message_id is not always an int #4
Comments
I did not understand this requirement. Why would you want it to be string
when doing a dry_run?
|
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. |
Addressed this with 0.2.0 using serde::json custom deserialising for that field. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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();
The text was updated successfully, but these errors were encountered: