-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Labels
Description
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.