-
-
Notifications
You must be signed in to change notification settings - Fork 893
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
Duplicates?... #117
Comments
'Looks like a valid v4 id. If possible, I would suggest stepping into the uuid.v4() method to see if it's actually generating the same random #'s each time at this line. Also, do |
+1, i'm getting duplicates as well, am i missing something? |
Could it be the compiler is doing a weird optimization having |
Can you guys test this now? It sounds like it may have been related to the recently closed bug where |
Also getting duplicates when using uuid.v1() as a default mongoose field. |
Also getting duplicates with uuid.v4(), a server restart is required to change the value. I fixed it by wrapping the library in a service to force the runtime evaluation of the v4() method : const uuid = require('node-uuid');
module.exports = {
v4: () => uuid.v4,
}; |
+1 Is there a fix for the duplicate ids? |
Haven't seen a recipe to reproduce this. Not enough info to diagnose. Until that changes this isn't actionable. |
I have been experiencing the same issue with an aws lambda and nodejs8.10 container |
We have the exact same issue only running on docker containers... some suggestions ? |
I'll reopen if/when someone provides a SCCEE for reproducing the problem. Better still, identify a fix and submit a PR. (My apologies but I simply don't have time to chase this down based on the vague descriptions given so far.) |
Refer to antoine-duchenet's post above. If you call the function directly as a property value (for example) without forcing it to evaluate fresh at run-time, you'll just end up with a static value. Hard to say that's the issue everyone is experiencing, but in my case it was the solution.
|
@FuzzySockets: I'm confused. What you're describing is exactly what I would expect. The first case is just assigning the result of
|
@broofa At the time I was following along with an example that (incorrectly) showed how to generate unique uuids for a mongoose model. Without having ever used node-uuid before, you might just assume either uuid returns a random generator function vs a static value which is where my error resided, or that mongoose encloses the model object, therefore calling the function each time you instantiate the model. |
2022 Jun. Getting duplicates |
I have an action that will get two unique tasks from an array of ten items. The action is triggered manually. If the same task is selected on different actions the id assigned is repeated.
|
@Rasfuranku: On the rare occasion we've seen issues with duplicates, it's most often because the runtime involved provides a random-number API (e.g. Provide a Minimal, Complete, and Verifiable example] and I'll be happy to take a look. |
@broofa Thanks for the reply and your help. Here is the code flow of how it is used; I hope it is enough: When creating a second or third bot with a task already assigned to a previous bot, the id for the task gets repeated. Node version: v16.17.1 React component: Here, I am also using
The function where UUIDs generate repeated ids.
The task Array example:
|
@Rasfuranku Sadly, it's not. Please carefully read the article I linked to, especially the parts about an example being reproducible and verifiable. |
@broofa I found that I was an idiot, and I was mutating the object before adding it to the array. Thanks for your time. |
This could happen in Lambda env. More context here: https://stackoverflow.com/questions/65369650/aws-lambda-and-uuid-it-always-return-same-value |
@t1maccapp: SO question is a result of user error and is not relevant to this project (as is clearly explained by the one and only answer there.) Locking thread as it's been a while since there was any productive conversation. If you're contemplating reporting an issue with
|
node-uuid is required in paypal-rest-sdk and called on line 60 in this file. For some reason, I'm getting returned the same uuid consecutively. I don't know if it is paypal-rest-sdk, node-uuid, Mac OS X, pm2? I've tried restarting all of my instances. I'm about to console.log the returned UUID.
I get 'e7d48462-0cdb-4291-a4c7-8adeade30193' repeatedly.
The text was updated successfully, but these errors were encountered: