Commit decd174
committed
fix(cli): resolve http.server via getServiceAsync in console/runtime-assets plugins
The console-static + runtime-assets plugins fetched `http.server` with the
synchronous `ctx.getService('http.server')`. When that service is registered
as an async factory (the console / schema-migration boot path) the sync
accessor throws `Service 'http.server' is async - use await`; sitting outside
any try/catch, the throw escaped the plugin's start() and rolled back kernel
bootstrap, crashing the CONSOLE/migration boot (com.objectstack.runtime-assets
failed to start). The runtime serve path, where http.server is registered
synchronously, was unaffected — which is why only the control-plane migration
boot broke.
Resolve http.server through a shared resolveHttpServer() helper that prefers
getServiceAsync (which resolves a sync- or async-registered service) and falls
back to the sync accessor, mirroring plugin-auth's async cache lookup. The
helper never throws, so these optional static-asset plugins skip cleanly when
no HTTP server is present instead of taking down boot.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsVkwjvWDBRiYb1HNGfcXr1 parent cb662a5 commit decd174
2 files changed
Lines changed: 57 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
328 | 328 | | |
329 | 329 | | |
330 | 330 | | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
331 | 363 | | |
332 | 364 | | |
333 | 365 | | |
| |||
347 | 379 | | |
348 | 380 | | |
349 | 381 | | |
350 | | - | |
| 382 | + | |
351 | 383 | | |
352 | 384 | | |
353 | 385 | | |
| |||
468 | 500 | | |
469 | 501 | | |
470 | 502 | | |
471 | | - | |
| 503 | + | |
472 | 504 | | |
473 | 505 | | |
474 | 506 | | |
| |||
0 commit comments