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

Implement ClientIdProvider #6

Open
ddolcimascolo opened this issue Nov 18, 2015 · 0 comments
Open

Implement ClientIdProvider #6

ddolcimascolo opened this issue Nov 18, 2015 · 0 comments

Comments

@ddolcimascolo
Copy link
Contributor

Currently when the library needs a clientId (when storing OutboundMessage instances as drafts for instance) it simply uses Date.now() as the client id. While this is fine for now, and probably enough for our needs at the moment, this is a problem for two reasons:

  • Date.now has millisecond precision. Trying to get two different client ids during the same millisecond would produce two identical ids.
  • The logic used to generate client ids should be configurable by clients of the library, thus I suggest that we implement a ClientIdProvider, and the library will provide a default implementation that we'll need to write as part of this issue too !

The provider would be given at Clientconstruction time, along with the Transport and PromiseProvider.

ddolcimascolo referenced this issue in ddolcimascolo/jmap-client Feb 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant