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

No updateClient method #67

Closed
mattheworiordan opened this issue Jul 12, 2015 · 3 comments
Closed

No updateClient method #67

mattheworiordan opened this issue Jul 12, 2015 · 3 comments
Assignees
Labels
enhancement New feature or improved functionality.

Comments

@mattheworiordan
Copy link
Member

Following on from the conversation we had in Slack, I believe that updateClient should be added to the client library as it follows our spec, is already available in other client libraries, and I believe is a valid function.

I understand that a client library may not know if a client has already entered or not, and as such updateClient and enterClient can be used interchangeably in may ways because the server will decide if the action is an UPDATE or ENTER action, however I find it odd that we would expect a developer to use the enterClient method even when they know that the client is present, and actually what they want to do is update their data.

@paddybyers and @kouno, thoughts please

@mattheworiordan mattheworiordan added the enhancement New feature or improved functionality. label Jul 12, 2015
@kouno
Copy link
Contributor

kouno commented Jul 13, 2015

If only for consistency, we should probably add updateClient to ably-js.

As the question of "Should updateClient even exist?", if we see some logic in enter and update being two different method on the client side, we should also see the same logic with enterClient and updateClient.

The only difference is that we give control to another person to push state for this client. If person A owns the right to update its presence, why would person B not be able to call updateClient?

If I'm following @paddybyers' logic, that means that we should also remove the update method.

@mattheworiordan
Copy link
Member Author

Our realtime protocol supports UPDATE, see http://docs.ably.io/client-lib-development-guide/protocol/. An UPDATE is a perfectly valid and appropriate request for both presence#update as well as presence#updateClient. However, if an UPDATE is sent when the member is not present, and only the core can know that, then this is converted to a ENTER, and if on the other hand an ENTER is sent when a member is already present, then that is converted to an UPDATE. In all cases, I still think it is perfectly valid to differentiate the two.

@paddybyers
Copy link
Member

I agree we should add updateClient().

@SimonWoolf : could you have a look at this please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improved functionality.
Development

No branches or pull requests

4 participants