Skip to content

Implement ClientIdProvider #6

@ddolcimascolo

Description

@ddolcimascolo

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions