ably / specification

The Ably features spec for client library SDKs.
Apache License 2.0
0 stars 4 forks source link

Manually sync device with Ably by replacing LocalDevice's details #71

Open tcard opened 7 years ago

tcard commented 7 years ago

From https://github.com/ably/realtime/pull/993#issuecomment-297006955:


There is no means to synchronise device updates from Ably to the client. I don't think this is ever necessary but we'd need the docs to reflect this. However, we should disallow setting metadata in activate as well so as to ensure only users with push-admin have the right to configure metadata for a device.

The device is storing state it does not need i.e. platform, formFactor, metadata which means that it can be out of sync with Ably. This is especially so for metadata, clientId, updateToken, push etc. Again, we should make no attempt to keep it in sync and should simply state that in the docs. Perhaps a far better solution would be to never expose the complete LocalDevice object under Realtime.device, however I think this could be a bit tricky as we'd need to then expose device.id, device.updateToken & device.push.recipient separately.

I think the simplest thing to do is to allow users to provide new LocalDevice details (replace(DeviceDetails) method?), which they're supposed to have synchronized themselves by GETting them with push-admin permissions. But yes, even then, it could be left partially out of sync. There's not much harm in that with the current use cases. If we ever want to ensure server->client synchronization, we could do introduce an self-increasing version number which must be included in every update operation, and if it's out of date with the current version, you must first synchronize by GETting, then resolve the conflicts with your change however you see fit. But, well, not now.

┆Issue is synchronized with this Jira Task by Unito

paddybyers commented 6 years ago

This is listed as a post-launch requirement. I don't think it's a priority for 1.1.

sync-by-unito[bot] commented 2 years ago

➤ Automation for Jira commented:

The link to the corresponding Jira issue is https://ably.atlassian.net/browse/SDK-2816