Uh oh!
There was an error while loading. Please reload this page.
Conversation
thomcc
left a comment
There was a problem hiding this comment.
Just happened across this, and will note some issues I see here that will save you time or are subtle.
Haven't looked at the part where you actually call things from kotlin, i suspect a lot of this is based on how we were doing things on the kotlin side before we switched to using handles for almost everything.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
jonalmeida
left a comment
There was a problem hiding this comment.
I realise this is still a WIP, but also consider my comments more as questions from a limited understanding on the internals of push. 😸
Uh oh!
There was an error while loading. Please reload this page.
| sender_id: String, | ||
| server_host: String?="push.service.mozilla.org", | ||
| socket_protocol: String?="https", | ||
| bridge_type:String?="fcm", |
There was a problem hiding this comment.
For the bridge_type, what are the valid types? Maybe it's easier with some typed class?
There was a problem hiding this comment.
I'll look into adding a typed class for this, but I'm definitely a Kotlin noob. I'll see if there's anything like an enumeration that could be used.
Uh oh!
There was an error while loading. Please reload this page.
| socket_protocol: String?="https", | ||
| bridge_type:String?="fcm", | ||
| encryption_key: String? = null) : PushAPI, AutoCloseable { | ||
| private var conn: RawPushConnection? |
There was a problem hiding this comment.
From my limited understanding, I believe this is a long-lived socket connection. If so, is there an automatic retry?
There was a problem hiding this comment.
It's not quite a long lived connection, at least not on mobile.
Mobile will be using whatever the native messaging service offers. There are some calls that need to be made to the server, and those will be handled by the push connection. We're also going to wrap these inside of a "PushManager" which will handle more things like decryption and managing the individual connections.
As far as you should be concerned, there should be a fairly small set of functions that you'll need to call. You will have to keep some state, though, for things like which ChannelID goes to what callback, but ideally, we'll try to keep as much of that out of your hair as possible.
| open class UrlParseFailed(msg: String): PushException(msg) | ||
| open class InvalidPlaceInfo(msg: String): PushException(msg) | ||
| open class PushConnectionBusy(msg: String): PushException(msg) | ||
| * @return Map of ChannelID: Endpoint, be sure to notify apps registered to given |
There was a problem hiding this comment.
Would it be expected that the android component calls this check before performing any action first?
There was a problem hiding this comment.
Not necessarily. This check can be a bit expensive, since it fetches content from the server and iterates through known connections. It's more a general "sanity check" on the known data state. Calling it once a day should be sufficient.
In the past we've had a few occasions where a client has gotten out of sync with the server. This has resulted in the subscription provider never knowing that a given subscription is no longer valid and sending effectively useless data to the Push Service. This function provides a way to rectify that situation in the future.
1f4a193 to
9c188aaCompare
thomcc
left a comment
There was a problem hiding this comment.
A lot of the FFI code is busted, due to using handles on the Rust side, but a PointerType subclass on the Kotlin side.
I suspect you can leverage ffi_support for making a bunch of the ffi rust code simpler too.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
thomcc
left a comment
There was a problem hiding this comment.
Unsure about the package naming. I thought the only one that wasn't a domain name was the actual namespace in the code. @ncalexan: Ping?
You also need to add yourself to the megazords.
- add to the cargo.toml: (for example https://github.com/mozilla/application-services/blob/master/megazords/reference-browser/Cargo.toml)
- add to the lib.rs (for example https://github.com/mozilla/application-services/blob/master/megazords/reference-browser/src/lib.rs#L8)
- Add to the megazord definition list https://github.com/mozilla/application-services/blob/master/gradle-plugin/src/main/kotlin/mozilla/appservices/AppServicesExtension.kt#L38
- bump https://github.com/mozilla/application-services/blob/master/gradle-plugin/build.gradle#L3 (and after a release goes out with these changes, we need to talk to @ncalexan to bump the plugin version)
Or those steps can be done in another PR.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
pjenvey
commented
Mar 5, 2019
thanks Thom, we'll revisit this one after merging this |
jrconlin
commented
Mar 5, 2019
doing the auto-squash might be a bit problematic due to age and intervening commits. If preferred, I'm fine doing a manual squash to reduce the total number of commits. |
thomcc
left a comment
There was a problem hiding this comment.
Looks good, but you need to update megazords/fenix/android/src/main/java/mozilla/appservices/FenixMegazord.java, megazords/fenix/src/lib.rs, I think
ncalexan
commented
Mar 20, 2019
Sorry, this got lost in my github firehose. I published an updated version of the plugin for Grisha's use at the end of last week. |
rfk
commented
Mar 20, 2019
Do we have a doc where JR should have been able to find this step (and its sub-steps)? |
thomcc
commented
Mar 20, 2019
We don't (it's on my TODO) but I did describe the rough steps #683 (review) |
No description provided.