Commit af92b53
committed
fix: replace crypto.randomUUID with universal generateId utility (#3393)
Replace all direct crypto.randomUUID() calls with a generateId() helper
that falls back to the uuid package when crypto.randomUUID is unavailable.
crypto.randomUUID() is only available in secure contexts (HTTPS or
localhost). When Sim is self-hosted via Docker and accessed over plain
HTTP on a LAN, the call throws "crypto.randomUUID is not a function"
and the page white-screens.
Changes:
- Add generateId() utility in lib/core/utils/id.ts that tries
crypto.randomUUID() first, then falls back to uuid v4 (already
a dependency)
- Replace all 200+ crypto.randomUUID() calls across 117 files
- Keep the existing layout.tsx polyfill as defense-in-depth for
third-party code
- Add mockGenerateId() to the testing package for test consistency
> **AI Disclosure:** This PR was authored by an AI agent (Claude, Anthropic).
> All code changes, analysis, and PR description were generated autonomously.
> A human (Max Calkin, @MaxwellCalkin) provided the prompt and submitted this PR.
Closes #33931 parent 8c0a2e0 commit af92b53
File tree
119 files changed
+456
-298
lines changed- apps/sim
- app
- api
- auth/shopify/authorize
- copilot/chat
- credential-sets
- [id]
- invite
- members
- invite/[token]
- memberships
- credentials
- [id]
- members
- draft
- environment
- folders
- [id]/duplicate
- mcp
- servers
- workflow-servers
- [id]/tools
- memory
- permission-groups
- [id]/members
- bulk
- superuser/import-workflow
- table/[tableId]/rows
- upsert
- tools
- a2a/send-message
- search
- stt
- tts/unified
- video
- v1
- admin
- workflows/import
- workspaces/[id]
- import
- members
- audit-logs
- [id]
- copilot/chat
- logs
- [id]
- workflows
- [id]
- webhooks
- workflows
- workspaces
- [id]
- environment
- permissions
- chat
- [identifier]
- components/input
- hooks
- workspace
- [workspaceId]
- providers
- w
- [workflowId]
- components
- chat
- hooks
- panel/components
- copilot/components/user-input/hooks
- deploy/components/deploy-modal/components/a2a
- editor/components/sub-block/components
- document-tag-entry
- dropdown
- eval-input
- filter-builder
- knowledge-tag-filters
- sort-builder
- starter
- table
- variables-input
- components/sidebar/components/settings-modal/components/subscription/components/credit-balance
- hooks
- providers
- executor/handlers/workflow
- hooks
- queries/a2a
- lib
- a2a
- auth
- billing
- core
- webhooks
- copilot
- client-sse
- orchestrator
- tool-executor
- deployment-tools
- workflow-tools
- tools/server
- knowledge
- user
- workflow/edit-workflow
- core
- async-jobs/backends
- utils
- credentials
- knowledge/documents
- table
- workflows
- operations
- persistence
- schedules
- workspaces
- serializer
- socket/handlers
- stores
- chat
- copilot-training
- notifications
- panel
- copilot
- variables
- terminal/console
- undo-redo
- workflows
- subblock
- workflow
- tools/langsmith
- packages/testing/src/mocks
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
119 files changed
+456
-298
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
161 | 162 | | |
162 | 163 | | |
163 | 164 | | |
164 | | - | |
| 165 | + | |
165 | 166 | | |
166 | 167 | | |
167 | 168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
188 | 189 | | |
189 | 190 | | |
190 | 191 | | |
191 | | - | |
| 192 | + | |
192 | 193 | | |
193 | 194 | | |
194 | 195 | | |
| |||
474 | 475 | | |
475 | 476 | | |
476 | 477 | | |
477 | | - | |
| 478 | + | |
478 | 479 | | |
479 | 480 | | |
480 | 481 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
108 | | - | |
| 109 | + | |
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
113 | | - | |
| 114 | + | |
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
167 | 168 | | |
168 | 169 | | |
169 | 170 | | |
170 | | - | |
| 171 | + | |
171 | 172 | | |
172 | 173 | | |
173 | 174 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
125 | 126 | | |
126 | 127 | | |
127 | 128 | | |
128 | | - | |
| 129 | + | |
129 | 130 | | |
130 | 131 | | |
131 | 132 | | |
132 | | - | |
| 133 | + | |
133 | 134 | | |
134 | 135 | | |
135 | 136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
63 | | - | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
148 | 149 | | |
149 | 150 | | |
150 | 151 | | |
151 | | - | |
| 152 | + | |
152 | 153 | | |
153 | 154 | | |
154 | 155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
133 | 134 | | |
134 | 135 | | |
135 | 136 | | |
136 | | - | |
| 137 | + | |
137 | 138 | | |
138 | 139 | | |
139 | 140 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
222 | 223 | | |
223 | 224 | | |
224 | 225 | | |
225 | | - | |
| 226 | + | |
226 | 227 | | |
227 | 228 | | |
228 | 229 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
78 | | - | |
| 79 | + | |
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| |||
0 commit comments