-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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(editor): Polyfill crypto.randomUUID #12052
Conversation
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
// Polyfill crypto.randomUUID | ||
if (!('randomUUID' in crypto)) { | ||
Object.defineProperty(crypto, 'randomUUID', { value: uuid }); | ||
} |
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.
Just to be sure. The window.crypto
object is always defined, and it's just randomUUID
that's missing?
n8n Run #8219
Run Properties:
|
Project |
n8n
|
Branch Review |
CAT-398-polyfill-randomUUID
|
Run status |
Passed #8219
|
Run duration | 04m 25s |
Commit |
e16cb880a9: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 netroy 🗃️ e2e/*
|
Committer | कारतोफ्फेलस्क्रिप्ट™ |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
2
|
Pending |
0
|
Skipped |
0
|
Passing |
480
|
View all changes introduced in this branch ↗︎ |
✅ All Cypress E2E specs passed |
Got released with |
Summary
When n8n is used in an insecure context,
window.crypto
is an empty object, because crypto API is only available in secure contexts.This PR uses the
uuid
package to polyfillcrypto.randomUUID
for such cases.Related Linear tickets, Github issues, and Community forum posts
CAT-398
Fixes #12051
Review / Merge checklist
release/backport
(if the PR is an urgent fix that needs to be backported)