You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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.
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
The text was updated successfully, but these errors were encountered: