-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Make the Web Locks uniqueName
helper (likely) globally unique
#15018
Conversation
I think we'd usually use |
I didn't know we had a helper. @inexorabletash does that look good to you, are there constraints on what the lock name should look like to be "realistic"? |
Using No "realistic" constraints on lock names. |
self.uniqueName = (testCase, prefix) => { | ||
return `${self.location.pathname}-${prefix}-${testCase.name}-${++res_num}`; | ||
const rand = Math.floor(1e10 * Math.random()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it helps, I've used this in some personal projects -- Math.random().toString(36).substr(2)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooops, forgot to actually review this.
This is fine, but using token()
would be better, wouldn't it?
Yes, I should use |
Closing this before it's two years old, since clearly I'm not going to prioritize fixing this using |
Fixes #15015.