This is a Rust a2 apns push notifications library wrapper for using the library in the C++ codebase to send the push notifications to iOS devices.
Linear task: ENG-1303
Differential D4540
[services] Tunnelbroker - Rust APNS push notifications A2 library wrapper • max on Jul 14 2022, 8:18 AM. Authored by Tags None Referenced Files
Details This is a Rust a2 apns push notifications library wrapper for using the library in the C++ codebase to send the push notifications to iOS devices. Linear task: ENG-1303
Patch to D4807 (top of the stack) using arc patch D4807.
Patch to D4807 (top of the stack) using arc patch D4807.
Patch to D4807 (top of the stack) using arc patch D4807. Library apns notifications push method can be called from the C++ as: #include "rust-notifications/src/lib.rs.h" #include "rust/cxx.h" ... const unsigned short responseCode = sendNotifToAPNS( char const *certificatePath, char const *certificatePassword, char const *deviceToken, char const *message, bool const *sandbox );
Diff Detail
Event TimelineThere are a very large number of changes, so older changes are hidden. Show Older Changes Comment Actions The first line of crate documentation https://crates.io/crates/a2 says that
So this is only for APN, which is reflected in function name sendNotifToAPNS.
E.g. in a comment there
So what is the plan for FCM? I can't see any info about it.
Comment Actions I've split APNS and FCM into two diffs, FCM will be a follow-up on this one. Sorry I didn't update this diff title and description.
Comment Actions Can we create an Error type for this library and avoid panicking? It's fine in the lazy_static block, but I don't like the use of unwrap elsewhere Edit: Alternatively we can use anyhow. See this example: https://cxx.rs/binding/result.html#returning-result-from-rust-to-c
Comment Actions Using Anyhow and Result instead of bool as a return. Comment Actions Good catch! I've changed to use Result and Anyhow. The code is much simpler with this approach by the way.
Comment Actions Overall looks pretty standard for rust (at least from my intermediate knowledge of rust). Would be nice to get some CI with tests involved so we can we can get away from having people do larger test plans (different issue). I was unable to arc patch from master, but that's likely to be an issue which can be solved with a rebase. Comment Actions Android build fail isn't related to this diff: error An unexpected error occurred: "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz: Request failed \"503 Service Unavailable\"". Comment Actions
You should be able to click on the gate, then select "restart build" on the right hand side. Comment Actions Oh, I thought the state in phabricator will not update on this (it's linked to some unique id of the build run). That's cool, thanks! Comment Actions The tricky thing here is if you restart a job from the Buildkite UI it won't be reflected in Phabricator, but if you restart a build from Phabricator (via Harbormaster) it will be reflected Comment Actions That makes sense because Harbormaster will link to a new unique build id (or something like that). Thanks for a clarification @atul ;)
Comment Actions Android build error is unrelated to this diff (it doesn't touch any Android stuff), it fails with the downloading timeout. |