Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

Bug in utils.js createId(), may create duplicate subscription id's #91

Open
hakjac opened this issue Nov 5, 2020 · 0 comments
Open

Comments

@hakjac
Copy link

hakjac commented Nov 5, 2020

The createId() method is supposed to create unique subscription ids, but as it is implemented today it may create duplicate id's when several id's is generated during the same millisecond, since it just appends a random number between 0-1000 to the current millisecond.

The method must ensure to never return an id that previously been returned. There are several options of doing this, e.g. keeping track and checking against the id's generated for the current millisecond is one way.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant