-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(cloudflare): Allow non uuid workflow instance IDs #17121
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
fix(cloudflare): Allow non uuid workflow instance IDs #17121
Conversation
packages/cloudflare/src/workflows.ts
Outdated
if (!UUID_REGEX.test(instanceId)) { | ||
throw new Error("Invalid 'instanceId' for workflow: Sentry requires random UUIDs for instanceId."); | ||
} | ||
async function hashStringToUuid(input: string): Promise<string> { |
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.
can we add some unit tests for this? Lets test some different kind of inputs.
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.
Also changed this to be called deterministicTraceIdFromInstanceId
since that's what it actually does!
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.
We have to backport this for v9 as well btw
7004f5c
to
acd3ecf
Compare
- A backport to v9 of #17121 - Closes #17074 @StephenHaney unless you're a very early adopter of v10, this PR is probably the one you care about!
If the
instanceId
is not a uuid like string (ie. 32 hex characters with or without hyphens) we SHA1 hash theinstanceId
to create a uuid.