Commit 06d7ce7
authored
feat(timeout): add API block timeout configuration (#3053)
* feat(timeout): add timeout subblock to the api block
* fix(timeout): honor timeout config for internal routes and fix type coercion
- Add AbortController support for internal routes (/api/*) to honor timeout
- Fix type coercion: convert string timeout from short-input to number
- Handle NaN gracefully by falling back to undefined (default timeout)
Fixes #2786
Fixes #2242
* fix: remove redundant clearTimeout in catch block
* fix: validate timeout is positive number
Negative timeout values would cause immediate request abort since
JavaScript treats negative setTimeout delays as 0.
* update docs image, update search modal performance
* removed unused keywords type
* ack comments
* cleanup
* fix: add default timeout for internal routes and validate finite timeout
- Internal routes now use same 5-minute default as external routes
- Added Number.isFinite() check to reject Infinity values
* fix: enforce max timeout and improve error message consistency
- Clamp timeout to max 600000ms (10 minutes) as documented
- External routes now report timeout value in error message
* remove unused code1 parent 1bc476f commit 06d7ce7
File tree
11 files changed
+139
-129
lines changed- apps
- docs/public/static
- sim
- app/workspace/[workspaceId]/w
- [workflowId]/components/panel/components/editor/components/sub-block/components/tool-input
- components/sidebar/components/search-modal
- blocks/blocks
- lib/core/security
- stores/modals/search
- tools
- http
11 files changed
+139
-129
lines changedLoading
Lines changed: 0 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | 183 | | |
198 | 184 | | |
199 | 185 | | |
| |||
1155 | 1141 | | |
1156 | 1142 | | |
1157 | 1143 | | |
1158 | | - | |
1159 | | - | |
1160 | | - | |
1161 | | - | |
1162 | | - | |
1163 | | - | |
1164 | | - | |
1165 | | - | |
1166 | | - | |
1167 | | - | |
1168 | | - | |
1169 | | - | |
1170 | | - | |
1171 | | - | |
1172 | | - | |
1173 | 1144 | | |
1174 | 1145 | | |
1175 | 1146 | | |
| |||
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/search-modal.tsx
Lines changed: 74 additions & 75 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
21 | 38 | | |
22 | 39 | | |
23 | 40 | | |
| |||
48 | 65 | | |
49 | 66 | | |
50 | 67 | | |
| 68 | + | |
51 | 69 | | |
52 | 70 | | |
53 | 71 | | |
| |||
60 | 78 | | |
61 | 79 | | |
62 | 80 | | |
63 | | - | |
64 | 81 | | |
65 | | - | |
66 | 82 | | |
67 | 83 | | |
| 84 | + | |
68 | 85 | | |
69 | 86 | | |
70 | 87 | | |
| |||
79 | 96 | | |
80 | 97 | | |
81 | 98 | | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
117 | 142 | | |
118 | 143 | | |
119 | 144 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
125 | 155 | | |
126 | 156 | | |
127 | 157 | | |
128 | | - | |
129 | | - | |
| 158 | + | |
130 | 159 | | |
131 | 160 | | |
132 | 161 | | |
| |||
228 | 257 | | |
229 | 258 | | |
230 | 259 | | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | 260 | | |
254 | 261 | | |
255 | 262 | | |
| |||
278 | 285 | | |
279 | 286 | | |
280 | 287 | | |
281 | | - | |
282 | 288 | | |
283 | 289 | | |
284 | 290 | | |
| |||
295 | 301 | | |
296 | 302 | | |
297 | 303 | | |
298 | | - | |
299 | 304 | | |
300 | 305 | | |
301 | 306 | | |
| |||
313 | 318 | | |
314 | 319 | | |
315 | 320 | | |
316 | | - | |
317 | 321 | | |
318 | 322 | | |
319 | 323 | | |
| |||
331 | 335 | | |
332 | 336 | | |
333 | 337 | | |
334 | | - | |
335 | 338 | | |
336 | 339 | | |
337 | 340 | | |
| |||
371 | 374 | | |
372 | 375 | | |
373 | 376 | | |
374 | | - | |
375 | 377 | | |
376 | 378 | | |
377 | 379 | | |
| |||
458 | 460 | | |
459 | 461 | | |
460 | 462 | | |
461 | | - | |
462 | 463 | | |
463 | 464 | | |
464 | 465 | | |
| |||
468 | 469 | | |
469 | 470 | | |
470 | 471 | | |
471 | | - | |
472 | 472 | | |
473 | 473 | | |
474 | 474 | | |
| |||
478 | 478 | | |
479 | 479 | | |
480 | 480 | | |
481 | | - | |
482 | 481 | | |
483 | 482 | | |
484 | 483 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
83 | 92 | | |
84 | 93 | | |
85 | 94 | | |
| |||
90 | 99 | | |
91 | 100 | | |
92 | 101 | | |
| 102 | + | |
93 | 103 | | |
94 | 104 | | |
95 | 105 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
931 | 931 | | |
932 | 932 | | |
933 | 933 | | |
934 | | - | |
| 934 | + | |
935 | 935 | | |
936 | 936 | | |
937 | 937 | | |
| |||
1011 | 1011 | | |
1012 | 1012 | | |
1013 | 1013 | | |
1014 | | - | |
| 1014 | + | |
1015 | 1015 | | |
1016 | 1016 | | |
1017 | 1017 | | |
| |||
0 commit comments