sanath-2024 / fcm_v1

Simple Rust FCM server library (HTTP v1 API)
MIT License
4 stars 6 forks source link

Upgrade version #1

Closed Jasperav closed 1 year ago

Jasperav commented 1 year ago

The crate didn't compile locally for me, after I updated the version, it did.

sanath-2024 commented 1 year ago

Hmm, I have no problem compiling the crate as is on Ubuntu 20.04 and 22.04. The dependency on hyper-rustls resolves at version 0.23.2 for me, and I am using rustc version 1.67.1. Can you give me some more details on your platform and rustc version?

Jasperav commented 1 year ago

@sanath-2024 I have a MacStudio and running Rust 1.66, but it is always a good idea to update dependencies if there are no conflicts right?

sanath-2024 commented 1 year ago

I think ideally we should specify the lowest possible version of the dependency since Cargo should automatically update the client with the highest semver-compatible version. However, in this case, given that the changes between 0.23 and 0.24 are quite small even though they are technically not semver-compatible, I agree that an upgrade is warranted. I will test out the changes on my machine, and assuming that it still builds, I will approve the PR.

sanath-2024 commented 1 year ago

Alright so here are the results of my tests @Jasperav. After I updated the hyper-rustls dependency to 0.24, the build failed due to an error about conflicting versions of hyper-rustls. However, when I deleted Cargo.lock and the target/ directory and tried again, the build succeeded.

What's going on is that yup-oauth2 and fcm_v1 should never have two different versions of hyper-rustls. Either both should be using 0.23.2 or both should be using 0.24.0. This error is caused by the fact that hyper-rustls does not re-export its dependency on hyper-rustls. It also makes it unsafe to automatically upgrade the dependency for people who are using the fcm_v1 v0.2.0.

Furthermore, another reason why this was caused is that yup-oauth2 only did a minor bump from 8.1 to 8.2 while its dependency hyper-rustls did a major bump from 0.23 to 0.24. This is a pretty annoying issue to fix, since I can't just upgrade my own dependency to 0.24 without breaking things for everyone who has already downloaded 0.23. For now, I will lock the dependency on yup-oauth2 to 8.1. I will also make a PR on the yup-oauth2 crate to see if they can re-export their dependency on hyper-rustls. That way, we won't even have to explicitly specify a dependency on hyper-rustls and this problem will be avoided.

Jasperav commented 1 year ago

@sanath-2024 Alright that sounds logical, hopefully they will fix it soon. I am not in a rush, so I will just use my own fork at the time. Whatever I do, I can not get fcm_v1 working without changing the dependency.

sanath-2024 commented 1 year ago

Hi @Jasperav I just published a new version of the crate, 0.2.1, which I believe fixes this issue for the time being. Can you please let me know if 0.2.1 works for you? If so, I will yank 0.2.0 since it may cause problems for people who continue to download it.

Jasperav commented 1 year ago

@sanath-2024 Thanks, I can confirm I can use version 0.2.1 without any problems!

sanath-2024 commented 1 year ago

@Jasperav just letting you know that my PR on yup-oauth2 was accepted, and I have uploaded a new version of fcm_v1 (0.3.0) which settles this issue for good.

Jasperav commented 1 year ago

@sanath-2024 This is great! Thanks for the initiative! I will look into the APS struct next week somewhere and hopefully we can make the batch requests working as well during that time.