Commit 08fdfc8
fix(webapp): stop idle chat sessions erroring on their next message
Sending a message to a chat session that had been idle for a while could
fail. The session's realtime streams are created empty and auto-deleted
once they have been empty for the basin's delete-on-empty age, and a
message that arrived during the brief window while a stream was being
deleted failed with a conflict.
The default delete-on-empty age
(`REALTIME_STREAMS_BASIN_DELETE_ON_EMPTY_MIN_AGE`) is raised from 1 hour
to 30 days, matching the stream retention age, so an idle session's
streams are no longer removed out from under it. This age is now also
applied when a basin is reconfigured, not only when it is first created.
As an extra guard, a stream append that races the deletion is retried
with bounded backoff and recreates the stream instead of surfacing an
error.
Mono-RevId: de345da6508411a22df4179671e7161161d8b26b1 parent e3336ab commit 08fdfc8
3 files changed
Lines changed: 20 additions & 20 deletions
File tree
- apps/webapp/app
- services/realtime
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2523 | 2523 | | |
2524 | 2524 | | |
2525 | 2525 | | |
2526 | | - | |
| 2526 | + | |
2527 | 2527 | | |
2528 | 2528 | | |
2529 | 2529 | | |
| |||
Lines changed: 12 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
609 | 609 | | |
610 | 610 | | |
611 | 611 | | |
612 | | - | |
613 | | - | |
614 | | - | |
615 | | - | |
616 | | - | |
617 | | - | |
618 | | - | |
619 | | - | |
620 | 612 | | |
621 | 613 | | |
622 | 614 | | |
| |||
629 | 621 | | |
630 | 622 | | |
631 | 623 | | |
632 | | - | |
633 | | - | |
| 624 | + | |
| 625 | + | |
634 | 626 | | |
635 | 627 | | |
636 | 628 | | |
| |||
647 | 639 | | |
648 | 640 | | |
649 | 641 | | |
650 | | - | |
651 | | - | |
652 | | - | |
653 | | - | |
654 | | - | |
655 | | - | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
656 | 652 | | |
657 | | - | |
658 | | - | |
659 | 653 | | |
660 | 654 | | |
661 | 655 | | |
| |||
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
109 | 113 | | |
110 | 114 | | |
111 | 115 | | |
| |||
219 | 223 | | |
220 | 224 | | |
221 | 225 | | |
| 226 | + | |
222 | 227 | | |
223 | 228 | | |
224 | 229 | | |
225 | 230 | | |
226 | 231 | | |
227 | 232 | | |
228 | 233 | | |
| 234 | + | |
229 | 235 | | |
230 | 236 | | |
231 | 237 | | |
| |||
0 commit comments