Skip to content
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

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

Open
tcard opened this issue Nov 2, 2017 · 2 comments
Open

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

tcard opened this issue Nov 2, 2017 · 2 comments

Comments

@tcard
Copy link
Contributor

tcard commented Nov 2, 2017

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
Copy link
Member

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

@QuintinWillison QuintinWillison transferred this issue from ably/docs Oct 3, 2022
@sync-by-unito
Copy link

sync-by-unito bot commented Oct 17, 2022

➤ Automation for Jira commented:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants