Conversation
| constructor(string sender_id, optional string server_host = "updates.push.services.mozilla.com", optional string http_protocol = "https", string bridge_type, string registration_id, optional string database_path = "push.sqlite"); | ||
|
|
||
| [Throws=PushError] | ||
| SubscriptionResponse subscribe([ByRef] optional string channel_ID = "", [ByRef] optional string scope = "",[ByRef] optional string? appServerKey = null); |
There was a problem hiding this comment.
[ByRef] optional string? appServerKey = null is a handful 😅 but it's the closest representation of the type used there.
1ce6f69 to
f758ddd
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4431 +/- ##
=======================================
Coverage 74.71% 74.71%
=======================================
Files 47 47
Lines 4157 4157
=======================================
Hits 3106 3106
Misses 1051 1051 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
38e4c6d to
821ef2b
Compare
821ef2b to
4c6f520
Compare
| @@ -141,12 +141,12 @@ class PushTest { | |||
|
|
|||
There was a problem hiding this comment.
The changes in this file are the extent of the breaking changes...
A-Cwill have to turn theList<Byte>into aByteArray(whatdecryptused to return) if they'd like usingtoByteArray. It was either this, or have a small wrapper to do the conversion, I opted for the "less android code in a-s" approachchannelID->channelId: this is trivial but interesting, I tried setting it tochannel_ID, but the rust compiler gave me warnings to turn it intochannel_idto make it snake case. So either we make the breaking change, or we can silence the rust compiler... I almost opted for the latter, but wanted to get a second opinionPushError->PushException
mhammond
left a comment
There was a problem hiding this comment.
Great work Tarik - very thorough and well thought out! Please do complete those other todos before merging though - I'm worried about overloading the android-components people, so think we should have a PR up before merging.
But great work, thanks!
|
|
||
| // NOTE: this returns a `Vec<i8>` since the kotlin consumer is expecting | ||
| // signed bytes. | ||
| Ok(decrypted.into_iter().map(|ub| ub as i8).collect()) |
There was a problem hiding this comment.
Is this related to unsigned types being experimental in Kotlin? If so, I think that's no longer the case. (IOW, if it's possible to now use u8 here I think we should do so, but I've no idea how practical that is, so feel free to ignore!)
There was a problem hiding this comment.
Uhh yes, I used this because Android components expects a ByteArray, which is just one .toByteArray() away from a List<Byte>, but List<UByte> can't convert directly. So A-C will have to convert the List<UByte> to ByteArray through a UByteArray or a List<Byte>... which isn't that bad, but it would be the first time they interact with unsigned types over there 😅 I guess it's just a matter of do we want to do the conversion for them, or have them do the conversion themselves
|
Thanks Mark!! I created a pr on A-C to get feedback mozilla-mobile/android-components#10953
Edit: Yup, that's what we're doing, we already cut 83.0.0! I'll wait for that to make its way to AC |
|
This should be in a mergeable state! I'm planning to merge it sometime early next week and cut another major release. Once that's done I'll update mozilla-mobile/android-components#10953 to have the latest release. (cc: @mhammond and @jonalmeida, no action items, just letting you know my plan here in case you have any concerns or thoughts 😄) |
Fixes #4424
The commits in order:
This is ready for review 🚀 Before this merges though, a couple of TODOS: