Commit 353da20
committed
Fix initialization race conditions and improve error resilience.
- `getServerByName` now propagates errors from the internal `set-name` request instead of silently swallowing them.
- `onStart` failures no longer permanently brick the Durable Object. Errors are caught inside `blockConcurrencyWhile` (preserving the input gate) and the status is reset, allowing subsequent requests to retry initialization.
- `fetch()` now retries initialization when a previous `onStart` attempt failed, instead of skipping it because the name was already set.
- Errors in `fetch()` (including `onStart` failures and malformed props) are now caught and returned as proper 500 responses instead of crashing as unhandled exceptions.
- WebSocket handlers (`webSocketMessage`, `webSocketClose`, `webSocketError`) are now wrapped in try/catch so that transient `onStart` failures don't kill the connection — the next message will retry.1 parent 2c8ab5f commit 353da20
12 files changed
Lines changed: 239 additions & 76 deletions
File tree
- .changeset
- packages
- hono-party
- partyfn
- partyserver/src
- tests
- partysub
- partysync
- partywhen
- y-partyserver
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 70 | + | |
77 | 71 | | |
78 | 72 | | |
79 | 73 | | |
| |||
366 | 360 | | |
367 | 361 | | |
368 | 362 | | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
373 | 367 | | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | 368 | | |
378 | | - | |
| 369 | + | |
| 370 | + | |
379 | 371 | | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
391 | 380 | | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
392 | 388 | | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | 389 | | |
398 | 390 | | |
399 | 391 | | |
| |||
450 | 442 | | |
451 | 443 | | |
452 | 444 | | |
453 | | - | |
| 445 | + | |
454 | 446 | | |
455 | 447 | | |
456 | 448 | | |
| |||
477 | 469 | | |
478 | 470 | | |
479 | 471 | | |
480 | | - | |
| 472 | + | |
| 473 | + | |
481 | 474 | | |
482 | | - | |
483 | | - | |
484 | | - | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
485 | 478 | | |
486 | | - | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
487 | 486 | | |
488 | 487 | | |
489 | 488 | | |
| |||
496 | 495 | | |
497 | 496 | | |
498 | 497 | | |
499 | | - | |
| 498 | + | |
| 499 | + | |
500 | 500 | | |
501 | | - | |
502 | | - | |
503 | | - | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
504 | 504 | | |
505 | | - | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
506 | 512 | | |
507 | 513 | | |
508 | 514 | | |
509 | 515 | | |
510 | 516 | | |
511 | 517 | | |
512 | 518 | | |
513 | | - | |
| 519 | + | |
| 520 | + | |
514 | 521 | | |
515 | | - | |
516 | | - | |
517 | | - | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
518 | 525 | | |
519 | | - | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
520 | 533 | | |
521 | 534 | | |
522 | 535 | | |
| 536 | + | |
523 | 537 | | |
524 | 538 | | |
525 | | - | |
526 | | - | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
527 | 546 | | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
528 | 550 | | |
529 | 551 | | |
530 | 552 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
405 | 485 | | |
406 | 486 | | |
407 | 487 | | |
| |||
0 commit comments