-
Notifications
You must be signed in to change notification settings - Fork 25
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
Read and persist state
returned in ARTLocalDevice
/ ARTDeviceDetails
#1162
Comments
state
returned by POST /push/deviceRegistrations
in LocalDevice/ DeviceDetailsstate
returned in LocalDevice/ DeviceDetails
state
returned in LocalDevice/ DeviceDetailsstate
returned in LocalDevice
state
returned in LocalDevicestate
returned in ARTLocalDevice
/ ARTDeviceDetails
From slack discussion:
So, yes, this field is only updated manually by calling methods with |
We expose Regarding your comments:
|
Anyways, I mean there is no way to update |
@QuintinWillison and @paddybyers, this would be a breaking change but I think its much better to make a network request somewhere, so that this field is not null all the time (except for Push Admin use). |
One of possible solutions would be to have a system channel |
Are you suggesting automatically making the client set up a realtime channel permanently to receive any state changes?This is because Of course, we cannot use push notifications to update the failed states of Push, since if the state is failed, the push message won't be delivered. If by nature we cannot have it pushed to us, we should request it. Hence my network request suggestion :). |
True, but server can send all actual information upon system channel successfully attached. |
What's the point of all this overhead and complexity in both and realtime when we can update it when it matters by making a network request? (the user calls the |
Apparently we already have such a method in |
Yes absolutely, that's what I meant by
I think listing a device/ clients own subscriptions (device or client ID) should not require Push Admin, but it currently does because it uses the same exact endpoint. Please read #1162 (comment) A concern is if we need to add a new endpoint in realtime (or modify the existing one) so that non push admins can get this information too. |
I had a call with @paddybyers, here's what I thought he's trying to say: Concern: HTTP Request synchronizing with Activation State Machine StatePaddy had concerns with my suggestion of making an HTTP request to get device details from the server. This is because we would probably want to synchronise the device details data received with the local device state used by the activation state machine. I think this state is server state, not local device state, so we should be fine with synchronizing data from the server. SolutionTo avoid synchronizing or having the theoretical inconsistency between this method and local device, clients could make a network request to with Additional things Paddy said:
My thoughts:I think the bullet points above are problematic. He had to go to another call so I could not discuss further:
So my current suggestion is similar to my previous one, but slightly improved:
|
@ben-xD As a temporary solution I can spit a diagnostic message to the console like "To update 'state' field to an actual value you must call 'ARTPushDeviceRegistrations: get' first". Diagnostic messages is a common practice in Apple to notify API users about incorrect usage of the framework (a lot of them in AutoLayout f.e.). |
That won't update the field though? Calling |
Please don't use this practice. Auto Layout is a very different kettle of fish - and, actually, Apple's 'need' to emit those kind of diagnostics when people get it wrong is perhaps more indicative of problems in their API design. 🤔 In our context, being an SDK that gets embedded into somebody else's app, we can't be brushing stuff like this under the covers like that. Nobody is ever going to see those diagnostics - I guarantee it - as these kind of edge cases are much more likely to be happening at runtime on a customer's device. |
@ben-xD You are right, it only gets data, so looks like the new method really needed. |
Please see ably/specification#26 for the upcoming discussion with Realtime team. We have a video meeting to discuss this on Tuesday 9th November 2021. |
@maratal is this unblocked now based on the discussion in ably/specification#26 ? |
@jamienewcomb Yes, seems like it can be unblocked |
As mentioned by Ben earlier here - ably/specification#26, updated server endpoint now supports retrieving push state for the current device without What is now needed to push this issue forward:
Alternatively, we can skip adding the new method, as the old one (from |
I think we need to come to a cross-platform conclusion on how we want to solve this issue. I've created ably/specification#25, should we continue the conversation there? |
Good summary, thanks @lawrence-forooghian (let's continue there). |
Related issues #1264, #1268, ably/specification#25 |
I don't feel it's helpful to keep this issue open, now that the discussion has been moved to docs/spec. Thanks, @lawrence-forooghian and @maratal. If new work comes out of the spec discussion then that will create a new, focussed, well-scoped issue in this repository. |
In trying to make sure behaviour is correct in push notifications, I noticed that the
DeviceDetails.DevicePushDetails.state
is always null on Android and iOS. A user can get the LocalDevice by callingARTRealtime#device
, to get backARTLocalDevice
, which extends fromARTDeviceDetails
, which containsARTDevicePushDetails
. Unfortunately,@property (nullable, nonatomic) NSString *state;
is always nil.It looks like it was never implemented? This value is not null when using the http api/ dashboard, its just the fact that ably-cocoa and ably-java doesn’t ever use it. This value is definitely returned to SDKs which call
POST /push/deviceRegistrations
. However, it is also returned by other HTTP requests, e.g.PUT rest.ably.io/push/deviceRegistrations/<deviceId>
.Similar ably-java issue: ably/ably-java#697 Note, in ably-java it is an enum: active, failing and failed. It might be worth switching to use an enum. However, it is also null on Ably-java.
┆Issue is synchronized with this Jira Bug by Unito
The text was updated successfully, but these errors were encountered: