hftl-ims-research/wonder

id in identity.js is an timestamp

Opened this issue · 2 comments

  • Why is this variable called id? isn't it a timestamp?
    • or should it be an Id (maybe than it would be better to use the guid()-function)?

.getTime() returns the time in milliseconds since epoch. If two identities are created in one millisecond both would have the same id.

yes, that could be an issue. In this case the guid() function would be a better choice.
Anyway, I'm not sure at the moment, that the id field is used somewhere for something meaninfull. IMO the assigned rtcIdentity should make an Identity unique and therefore plays the role of an id already.